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

Create worker blocklist and add BlockWorker #324

Merged
merged 1 commit into from
Dec 8, 2023
Merged
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
7 changes: 6 additions & 1 deletion src/generate_worker_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
from metadata_schemas import worker_schema
import utils

# `block` work pool types should only be created via
# `Infrastructure.publish_as_work_pool`
# See https://github.com/PrefectHQ/prefect/pull/11180 for more details
WORKERS_BLOCKLIST = {"BaseWorker", "BlockWorker"}
Copy link
Collaborator

@zzstoatzz zzstoatzz Dec 7, 2023

Choose a reason for hiding this comment

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

👀



@task
def generate_worker_metadata(worker_subcls: Type[BaseWorker], package_name: str):
Expand Down Expand Up @@ -114,7 +119,7 @@ def discover_base_worker_subclasses(module: ModuleType) -> List[Type[BaseWorker]
for _, cls in inspect.getmembers(module)
if inspect.isclass(cls)
and issubclass(cls, BaseWorker)
and cls.__name__ != "BaseWorker"
and cls.__name__ not in WORKERS_BLOCKLIST
]


Expand Down