Skip to content

Commit

Permalink
add schema to StagePathParts
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pjafari committed Dec 3, 2024
1 parent 6475e23 commit ce71ebf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/snowflake/cli/_plugins/stage/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from snowflake.cli.api.console import cli_console
from snowflake.cli.api.constants import PYTHON_3_12
from snowflake.cli.api.identifiers import FQN
from snowflake.cli.api.project.util import to_string_literal
from snowflake.cli.api.project.util import extract_schema, to_string_literal
from snowflake.cli.api.secure_path import SecurePath
from snowflake.cli.api.sql_execution import SqlExecutionMixin
from snowflake.cli.api.stage_path import StagePath
Expand Down Expand Up @@ -86,6 +86,10 @@ def path(self) -> str:
def full_path(self) -> str:
raise NotImplementedError

@property
def schema(self) -> str | None:
raise NotImplementedError

def replace_stage_prefix(self, file_path: str) -> str:
raise NotImplementedError

Expand Down Expand Up @@ -145,6 +149,10 @@ def path(self) -> str:
def full_path(self) -> str:
return f"{self.stage.rstrip('/')}/{self.directory}"

@property
def schema(self) -> str | None:
return extract_schema(self.stage)

def replace_stage_prefix(self, file_path: str) -> str:
stage = Path(self.stage).parts[0]
file_path_without_prefix = Path(file_path).parts[OMIT_FIRST]
Expand Down

0 comments on commit ce71ebf

Please sign in to comment.