You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expecting to JSON returned in UDF, but received the following error when calling the UDF:
Traceback (most recent call last):
File "_udf_code.py", line 8, in process
File "/usr/lib/python_udf/fca69f3e27f8e37a6a12047c6ce59553c3e8fbbd8157e24384ef483acdf4ac81/lib/python3.8/json/init.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python_udf/fca69f3e27f8e37a6a12047c6ce59553c3e8fbbd8157e24384ef483acdf4ac81/lib/python3.8/site-packages/snowflake/snowpark/files.py", line 132, in read
raise NotImplementedError(_DEFER_IMPLEMENTATION_ERR_MSG)
NotImplementedError: SnowflakeFile currently only works in UDF and Stored Procedures. It doesn't work locally yet.
in function LOAD_JSON with handler process
It was working until this weekend.
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
NotImplementedError when using SnowflakeFile to read from External Staging in UDF
SNOW-893210: NotImplementedError when using SnowflakeFile to read from External Staging in UDF
Aug 15, 2023
This PuPr feature is temporarily disabled due to an issue (as a preventative measure) and will get re-enabled with a mitigation in the next few releases.
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using?
3.8
What operating system and processor architecture are you using?
"Linux-5.4.129-200.el7.x86_64-x86_64-with-glibc2.17"
What are the component versions in the environment (
pip freeze
)?What did you do?
CREATE OR REPLACE FUNCTION "LOAD_JSON"(file_path string)
RETURNS variant
LANGUAGE PYTHON
RUNTIME_VERSION = '3.8'
PACKAGES = ('snowflake-snowpark-python')
HANDLER = 'process'
AS
$$
import platform
from snowflake.snowpark.files import SnowflakeFile
import json
def process(file_path):
with SnowflakeFile.open(file_path, 'r') as f:
return json.load(f)
$$;
select "LOAD_JSON"(BUILD_SCOPED_FILE_URL(<<external_blob>>, <<file_path>>));
Expecting to JSON returned in UDF, but received the following error when calling the UDF:
Traceback (most recent call last):
File "_udf_code.py", line 8, in process
File "/usr/lib/python_udf/fca69f3e27f8e37a6a12047c6ce59553c3e8fbbd8157e24384ef483acdf4ac81/lib/python3.8/json/init.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python_udf/fca69f3e27f8e37a6a12047c6ce59553c3e8fbbd8157e24384ef483acdf4ac81/lib/python3.8/site-packages/snowflake/snowpark/files.py", line 132, in read
raise NotImplementedError(_DEFER_IMPLEMENTATION_ERR_MSG)
NotImplementedError: SnowflakeFile currently only works in UDF and Stored Procedures. It doesn't work locally yet.
in function LOAD_JSON with handler process
It was working until this weekend.
The text was updated successfully, but these errors were encountered: