Skip to content

Commit 1f5027a

Browse files
explicitly fall back to the connection's database and schema when constructing the stage FQN
1 parent 4635b8a commit 1f5027a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/snowflake/cli/_plugins/streamlit/streamlit_entity.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,16 @@ def _deploy_legacy(
260260
if isinstance(self.model.identifier, Identifier)
261261
else self.model.identifier or self.entity_id
262262
)
263+
# Get the fully qualified stage name, falling back to connection database/schema
264+
stage_fqn = FQN.from_string(self.model.stage)
265+
db_to_use = stage_fqn.database or self._conn.database
266+
schema_to_use = stage_fqn.schema or self._conn.schema
267+
if db_to_use:
268+
stage_fqn = stage_fqn.set_database(db_to_use)
269+
if schema_to_use:
270+
stage_fqn = stage_fqn.set_schema(schema_to_use)
263271
stage_root = StageManager.get_standard_stage_prefix(
264-
f"{FQN.from_string(self.model.stage).using_connection(self._conn)}/{name}"
272+
f"{stage_fqn.identifier}/{name}"
265273
)
266274
sync_deploy_root_with_stage(
267275
console=self._workspace_ctx.console,

0 commit comments

Comments
 (0)