title: Invalid operation: Failed to compile udf
body: <p>I have imported the fuzzywuzzy library on Redshift from S3. I am trying to create the below function:</p>
  <pre><code>CREATE OR REPLACE FUNCTION fuzzy_test (string_a TEXT,string_b TEXT) RETURNS FLOAT IMMUTABLE
  AS
  $$
  FROM fuzzywuzzy import fuzz
  RETURN fuzz.ratio (string_a,string_b)
  $$ LANGUAGE plpythonu;
  </code></pre>
  <p>But this is throwing an error:</p>
  <pre><code>[Amazon](500310) Invalid operation: Failed to compile udf
  Details: 
   -----------------------------------------------
    error:  Failed to compile udf
    code:      10000
    context:     File &quot;/rds/bin/padb.1.0.22169/data/udf/231/978476007/e3afd7ea37e0384bcaf415f60955b5eb6911e3ae/0.py&quot;, line 2
      FROM fuzzywuzzy import fuzz fz = fuzz()
                    ^
  SyntaxError: invalid syntax
  
    query:     0
    location:  cg_addins.cpp:257
    process:   padbmaster [pid=4211]
    -----------------------------------------------; [SQL State=XX000, DB Errorcode=500310]
  1 statement failed.
  </code></pre>
  <p>Please explain me what causing the error.</p>