admin管理员组

文章数量:1122832

When invoking a Snowpark-registered SPROC, I get the following error:

SnowparkSQLException: (1304): <uuid>: 100357 (P0000): <uuid>: Python Interpreter Error:
snowflake.connector.errors.ProgrammingError: 251005: User is empty in function MY_FUNCTION with handler compute

for the following python code and invocation:

def my_function(session: Session,
                input_table: str,
                limit: int) -> None:
    # Even doing nothing doesn't work!
    return

sproc_my_function = my_session.sproc.register(func=my_function,
                                           name='my_function',
                                           is_permanent=True,
                                           replace=True,
                                           stage_location='@STAGE_LOC',
                                           execute_as="owner",


input_table = 'x.y.MY_INPUT_TABLE'

sproc_process_row(my_session,
                  input_table,
                  100,
                  )

I can't find a reference to this exception and "User is empty in function" anywhere on the internet - which makes me wonder if its a drop-through of some sort. I also can't find a way to pass a user to the register method (this is already done successfully when my_session is set up).

Please help!

When invoking a Snowpark-registered SPROC, I get the following error:

SnowparkSQLException: (1304): <uuid>: 100357 (P0000): <uuid>: Python Interpreter Error:
snowflake.connector.errors.ProgrammingError: 251005: User is empty in function MY_FUNCTION with handler compute

for the following python code and invocation:

def my_function(session: Session,
                input_table: str,
                limit: int) -> None:
    # Even doing nothing doesn't work!
    return

sproc_my_function = my_session.sproc.register(func=my_function,
                                           name='my_function',
                                           is_permanent=True,
                                           replace=True,
                                           stage_location='@STAGE_LOC',
                                           execute_as="owner",


input_table = 'x.y.MY_INPUT_TABLE'

sproc_process_row(my_session,
                  input_table,
                  100,
                  )

I can't find a reference to this exception and "User is empty in function" anywhere on the internet - which makes me wonder if its a drop-through of some sort. I also can't find a way to pass a user to the register method (this is already done successfully when my_session is set up).

Please help!

Share Improve this question asked yesterday jtlz2jtlz2 8,38710 gold badges71 silver badges123 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Using Snowflake Notebooks:

from snowflake.snowpark.session import Session
my_session = snowflake.snowpark.context.get_active_session()

def my_function(session: Session,
                input_table: str,
                limit: int) -> None:
    return None

sproc_my_function = my_session.sproc.register(func=my_function,
                                           name='my_function',
                                           is_permanent=True,
                                           replace=True,
                                           stage_location='STAGE_LOC',
                                           execute_as="owner",
                                           packages=["snowflake-snowpark-python"])

Output:

本文标签: