-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c88faa
commit 62ffdd5
Showing
5 changed files
with
29 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# this test should relay on already deployed jobs | ||
|
||
import os | ||
|
||
from databricks.sdk import WorkspaceClient | ||
from databricks.sdk.service.compute import Language | ||
|
||
|
||
CLUSTER_ID = os.getenv('DATABRICKS_TEST_CLUSTER_ID') | ||
|
||
|
||
# needs to run before: databricks bundle deploy --target dev | ||
def test_main(): | ||
w = WorkspaceClient() # use DEFAULT profile | ||
jobs = w.jobs.list(name="marcin_project_job") | ||
job_id = next(job for job in jobs).job_id | ||
w.jobs.run_now_and_wait(job_id) | ||
|
||
ctx = w.command_execution.create(cluster_id=CLUSTER_ID, language=Language.SQL).result() | ||
command = "SELECT * FROM samples.nyctaxi.trips LIMIT 5;" | ||
results = w.command_execution.execute(cluster_id=CLUSTER_ID, command=command, context_id=ctx.id, language=Language.SQL).result() | ||
assert len(results.results.data) == 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters