Skip to content

Commit

Permalink
Update agent uri format (#1861)
Browse files Browse the repository at this point in the history
Signed-off-by: HH <hhcs9527@gmail.com>
  • Loading branch information
hhcs9527 authored Oct 1, 2023
1 parent a183186 commit 2f7073d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugins/flytekit-snowflake/flytekitplugins/snowflake/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def async_create(
name: TypeEngine.guess_python_type(lt.type) for name, lt in task_template.interface.inputs.items()
}
native_inputs = TypeEngine.literal_map_to_kwargs(ctx, inputs, python_interface_inputs)
logger.info(f"Create Snowflake params with inputs: {native_inputs}")
logger.info(f"Create Snowflake agent params with inputs: {native_inputs}")
params = native_inputs

config = task_template.config
Expand Down Expand Up @@ -125,7 +125,7 @@ async def async_get(self, context: grpc.ServicerContext, resource_meta: bytes) -

if cur_state == SUCCEEDED:
ctx = FlyteContextManager.current_context()
output_metadata = f"snowflake://{metadata.user}:{metadata.account}/{metadata.database}/{metadata.schema}/{metadata.warehouse}/{metadata.table}"
output_metadata = f"snowflake://{metadata.user}:{metadata.account}/{metadata.warehouse}/{metadata.database}/{metadata.schema}/{metadata.table}"
res = literals.LiteralMap(
{
"results": TypeEngine.to_literal(
Expand Down
2 changes: 1 addition & 1 deletion plugins/flytekit-snowflake/tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async def test_snowflake_agent(mock_conn, mock_get_private_key):
assert res.resource.state == SUCCEEDED
assert (
res.resource.outputs.literals["results"].scalar.structured_dataset.uri
== "snowflake://dummy_user:dummy_account/dummy_database/dummy_schema/dummy_warehouse/dummy_table"
== "snowflake://dummy_user:dummy_account/dummy_warehouse/dummy_database/dummy_schema/dummy_table"
)

delete_response = await agent.async_delete(ctx, metadata_bytes)
Expand Down

0 comments on commit 2f7073d

Please sign in to comment.