snowflakedb/snowflake-cli

SNOW-975719: It's not possible to create a function with external_access_integrations or secrets options

Closed this issue · 2 comments

Description

Function manager supports only limited set of parameters:

def create(
    self,
    identifier: str,
    return_type: str,
    handler: str,
    artifact_file: str,
    packages: List[str],
    overwrite: bool,
) -> SnowflakeCursor:
    create_stmt = "create or replace" if overwrite else "create"
    packages_list = ",".join(f"'{p}'" for p in packages)
    return self._execute_query(
        f"""\
        {create_stmt} function {identifier}
        returns {return_type}
        language python
        runtime_version=3.8
        imports=('@{artifact_file}')
        handler='{handler}'
        packages=({packages_list})
    """
    )

Context

No response

Hello @kokorin, I wrote a comment in the PR which you created (#559 (comment)) for this issue but I'll write here too that we are currently working on this feature. However we have different vision how to set external_access_integrations and secrets (more consistent with future 2.0.0 release) and we don't want to include it in 1.X releases as we don't plan to add new features there.

Already done in #560