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

Improve supervisor repr for debugging #8633

Merged
merged 2 commits into from
Feb 24, 2023
Merged

Improve supervisor repr for debugging #8633

merged 2 commits into from
Feb 24, 2023

Conversation

zanieb
Copy link
Contributor

@zanieb zanieb commented Feb 23, 2023

import concurrent.futures
import threading

import pytest

from prefect._internal.concurrency.supervisors import AsyncSupervisor, SyncSupervisor


def fake_submit_fn(__fn, *args, **kwargs):
    future = concurrent.futures.Future()
    future.set_result(__fn(*args, **kwargs))
    return future


def fake_fn(*args, **kwargs):
    pass


supervisor = SyncSupervisor(submit_fn=fake_submit_fn)
print(repr(supervisor))

supervisor.submit(fake_fn, 1, 2)
print(repr(supervisor))
<SyncSupervisor submit_fn='fake_submit_fn', owner='MainThread'>
<SyncSupervisor submit_fn='fake_submit_fn', submitted='fake_fn', owner='MainThread'>

vs previously

<SyncSupervisor(id=140242493845264, owner=8633447104)>
<SyncSupervisor(id=140242493845264, owner=8633447104)>

@zanieb zanieb requested a review from a team as a code owner February 23, 2023 17:44
@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for prefect-docs ready!

Name Link
🔨 Latest commit 7388aae
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs/deploys/63f8e3f4036bbb00085831fd
😎 Deploy Preview https://deploy-preview-8633--prefect-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@zanieb zanieb changed the base branch from main to supervisor/submit February 23, 2023 17:44
@zanieb zanieb changed the title supervisor/name Improve supervisor repr for debugging Feb 23, 2023
Base automatically changed from supervisor/submit to main February 24, 2023 16:20
@zanieb zanieb merged commit 2cd49cf into main Feb 24, 2023
@zanieb zanieb deleted the supervisor/name branch February 24, 2023 22:32
ddelange added a commit to ddelange/prefect that referenced this pull request Feb 27, 2023
* 'main' of https://github.com/prefecthq/prefect:
  Bump @playwright/test from 1.30.0 to 1.31.1 in /ui (PrefectHQ#8663)
  Bump @prefecthq/prefect-ui-library from 1.1.9 to 1.1.10 in /ui (PrefectHQ#8661)
  Bump vite from 4.1.2 to 4.1.4 in /ui (PrefectHQ#8662)
  Bump eslint from 8.34.0 to 8.35.0 in /ui (PrefectHQ#8664)
  Fix of a typo - removed repeated word (PrefectHQ#8654)
  Enable DefaultAzureCredential authentication for Azure filesystem block (PrefectHQ#7513)
  Improve supervisor repr for debugging (PrefectHQ#8633)
ddelange added a commit to ddelange/prefect that referenced this pull request Mar 1, 2023
…aceful-agent

* 'patch-1' of https://github.com/ddelange/prefect: (25 commits)
  Enhancement: Track flow run id when generating task run results (PrefectHQ#8674)
  Fix loading of existing deployment descriptions from the server (PrefectHQ#8675)
  Update Dask logo (PrefectHQ#8669)
  Update `send_call` to `send_call_to_supervisor` (PrefectHQ#8653)
  Add Netlify Edge function to proxy to Segment (PrefectHQ#8657)
  Add security headers for docs (PrefectHQ#8655)
  Override analytics block instead of partial (PrefectHQ#8656)
  Add description flag to prefect deployment build CLI command (PrefectHQ#8603)
  Add support for yaml config strings to `KubernetesClusterConfig` (PrefectHQ#8643)
  Change lazy loads from joined to selectin (PrefectHQ#8659)
  Add timeout support to supervisors (PrefectHQ#8649)
  Minor markdown link fix in orchestration docs (PrefectHQ#8660)
  Allow more ports
  Bump @playwright/test from 1.30.0 to 1.31.1 in /ui (PrefectHQ#8663)
  Bump @prefecthq/prefect-ui-library from 1.1.9 to 1.1.10 in /ui (PrefectHQ#8661)
  Bump vite from 4.1.2 to 4.1.4 in /ui (PrefectHQ#8662)
  Bump eslint from 8.34.0 to 8.35.0 in /ui (PrefectHQ#8664)
  Fix of a typo - removed repeated word (PrefectHQ#8654)
  Enable DefaultAzureCredential authentication for Azure filesystem block (PrefectHQ#7513)
  Improve supervisor repr for debugging (PrefectHQ#8633)
  ...
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