Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: Fix Databricks Pipeline Test Connection Fix #14667

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ def is_query_valid(self, row) -> bool:
or query_text.startswith(QUERY_WITH_OM_VERSION)
)

def list_jobs_test_connection(self) -> None:
data = {"limit": 1, "expand_tasks": True, "offset": 0}
self.client.get(
self.jobs_list_url,
data=json.dumps(data),
headers=self.headers,
timeout=API_TIMEOUT,
).json()

def list_jobs(self) -> List[dict]:
"""
Method returns List all the created jobs in a Databricks Workspace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ def test_connection(
of a metadata workflow or during an Automation Workflow
"""

def custom_executor_for_pipeline():
result = client.list_jobs()
return list(result)

test_fn = {"GetPipelines": custom_executor_for_pipeline}
test_fn = {"GetPipelines": client.list_jobs_test_connection}

test_connection_steps(
metadata=metadata,
Expand Down
Loading