Open sfc-gh-twhite opened 1 week ago
This presents a situation where a user may use a different database or schema and will likely attempt to fully qualify the stage. This wouldn't work. The only way to get around such a predicament today would be to have another instance of a Session
class available set to the particular database and schema where the stage housing the semantic file exists.
I really think we'll need to address how we're referencing the semantic_model_file here:
One option would be to support fully qualifying the stage path. Another option might be to support a database and a schema argument to initialize the CortexAnalystTool class. Both database and schema could be optional, especially if the stage is already in the current context.
cc: @sfc-gh-alherrera
If the user was to fully qualify the STAGE, such as
"stage": "CUBE_TESTING.PUBLIC.ANALYST",
we hit an unhandled exception:Caught unhandled exception: Unexpected error during Cortex gateway Tool request: Stage CUBE_TESTING.PUBLIC.CUBE_TESTING.PUBLIC.ANALYST does not exist or is not authorized
.We need to either document this behavior or internally handle the cases where a user fully qualifies the stage.
I suspect this will have implications on using tools when the connection context changes.