Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

jobs_runs_submit_and_wait_for_completion raises an error on import #97

Closed
ybressler opened this issue Jan 25, 2024 · 1 comment
Closed

Comments

@ybressler
Copy link

ybressler commented Jan 25, 2024

I have a flow which wraps the call for jobs_runs_submit_and_wait_for_completion:

@flow
def my_flow(databricks_credentials, job_task_settings):
    """Oversimplified"""
    task_run = jobs_runs_submit_and_wait_for_completion(
        databricks_credentials=databricks_credentials,
        tasks=[job_task_settings]
    )

    return task_run

But I receive the following error:

    raise SkipField(f'Callable {field.name} was excluded from schema since JSON schema has no equivalent type.')
E   pydantic.v1.schema.SkipField: Callable job_submission_handler was excluded from schema since JSON schema has no equivalent type.

Full stack trace:

 During handling of the above exception, another exception occurred:
test_run_notebook.py:6: in <module>
    from ...
../../../.../tasks/databricks/run_notebook.py:10: in <module>
    from prefect_databricks.flows import jobs_runs_submit_and_wait_for_completion
PATH/lib/python3.9/site-packages/prefect_databricks/flows.py:61: in <module>
    async def jobs_runs_submit_and_wait_for_completion(
PATH/lib/python3.9/site-packages/prefect/flows.py:1382: in flow
    Flow(
PATH/lib/python3.9/site-packages/prefect/context.py:186: in __register_init__
    original_init(__self__, *args, **kwargs)
PATH/lib/python3.9/site-packages/prefect/flows.py:307: in __init__
    self.parameters = parameter_schema(self.fn)
PATH/lib/python3.9/site-packages/prefect/utilities/callables.py:340: in parameter_schema
    create_schema(
PATH/lib/python3.9/site-packages/prefect/utilities/callables.py:296: in create_v1_schema
    return model.schema(by_alias=True)
PATH/lib/python3.9/site-packages/pydantic/v1/main.py:664: in schema
    s = model_schema(cls, by_alias=by_alias, ref_template=ref_template)
PATH/lib/python3.9/site-packages/pydantic/v1/schema.py:188: in model_schema
    m_schema, m_definitions, nested_models = model_process_schema(
PATH/lib/python3.9/site-packages/pydantic/v1/schema.py:582: in model_process_schema
    m_schema, m_definitions, nested_models = model_type_schema(
PATH/lib/python3.9/site-packages/pydantic/v1/schema.py:632: in model_type_schema
    warnings.warn(skip.message, UserWarning)
E   UserWarning: Callable job_submission_handler was excluded from schema since JSON schema has no equivalent type.

I am using poetry for dependency management.

My pyproject.toml: (oversimplified)

python = ">=3.8,<4"
prefect = ">=2.14.14"
pydantic = ">=2"
prefect-databricks = ">=0.2.3"

Python version 3.9.6

@ybressler
Copy link
Author

My error was unrelated to prefect-databricks, sorry for the noise!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant