Skip to content

Conversation

nfx
Copy link
Contributor

@nfx nfx commented Mar 28, 2023

Changes

  • Adds callback optional argument to every waiter.
  • Adds typed response where applicable to Wait instances.
  • Exposes .bind() on Wait for cross-process-boundary waiting.
  • examples/starting_job_and_waiting.py for a detailed demonstration.

Tests

  • make test run locally
  • make fmt applied
  • relevant integration tests applied

@nfx nfx requested a review from a team March 28, 2023 18:30
self._bind = kwargs

def __getattr__(self, key) -> any:
return self._bind[key]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this!

f.write(b'import time; time.sleep(10); print("Hello, World!")')

# trigger one-time-run job and get waiter object
waiter = w.jobs.submit(run_name=f'py-sdk-run-{time.time()}', tasks=[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great example that demonstrates all of the features. I like the interface.

@nfx nfx merged commit 5ea2818 into main Mar 29, 2023
@nfx nfx deleted the wait/improve branch March 29, 2023 09:38
joyaung pushed a commit to joyaung/databricks-sdk-py that referenced this pull request Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants