Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions python/pyspark/pipelines/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ def register_definitions(
- Import Python files matching the glob patterns in the spec.
- Register SQL files matching the glob patterns in the spec.
"""
path = spec_path.parent
path = spec_path.parent.resolve()

with change_dir(path):
with graph_element_registration_context(registry):
log_with_curr_timestamp(f"Loading definitions. Root directory: '{path}'.")
Expand Down Expand Up @@ -260,7 +261,7 @@ def register_definitions(
log_with_curr_timestamp(f"Registering SQL file {file}...")
with file.open("r") as f:
sql = f.read()
file_path_relative_to_spec = file.relative_to(spec_path.parent)
file_path_relative_to_spec = file.relative_to(path)
registry.register_sql(sql, file_path_relative_to_spec)
else:
raise PySparkException(
Expand Down