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

Async support for PDBDebugger #1201

Open
sT0v opened this issue Oct 23, 2024 · 1 comment
Open

Async support for PDBDebugger #1201

sT0v opened this issue Oct 23, 2024 · 1 comment
Labels
async enhancement New feature or request

Comments

@sT0v
Copy link
Contributor

sT0v commented Oct 23, 2024

Is your feature request related to a problem? Please describe.
sf-hamitlon=1.80.0
I would like to use PDBDebugger with async_driver.Builder().

from hamilton.lifecycle import PDBDebugger

dr =  asyncio.run(
    async_driver.Builder()
    .with_modules(__main__)
    .with_config({"env": "dev"})
    .with_adapters(
        # base.PandasDataFrameResult(), 
        # PDBDebugger("raw_loaded_report_data", after=True),
        PDBDebugger("raw_trades.missing_trade_attributes", during=True),
    )
    .build()
)

Raises : ValueError: Multiple adapters cannot (currently) implement the same lifecycle method. Sync methods: ['do_node_execute']. Async methods: []
even though there was only one adapter provided. I think this error is a bit imprecise?

Describe the solution you'd like
A clear and concise description of what you want to happen.
I would like to use PDBDebugger with async_driver.Builder().
If it makes sense, I'd also like to

Describe alternatives you've considered
Using pdb.set_trace() on lines I want to inspect.

Additional context
The async_driver requires the use of .with_adapters() but does not support multiple adapters.

 .with_adapters(
       base.PandasDataFrameResult(), 
       PDBDebugger("raw_trades.missing_trade_attributes", during=True),
    )

Raises: ValueError: Multiple adapters cannot (currently) implement the same lifecycle method. Sync methods: ['do_node_execute']. Async methods: []

@zilto
Copy link
Collaborator

zilto commented Oct 25, 2024

Thanks for reporting the issue. Currently, PDBDebugger isn't supported for async .

You're right that the error message can be ambiguous:

ValueError: Multiple adapters cannot (currently) implement the same lifecycle method. Sync methods: ['do_node_execute']. Async methods: []

In this case, the relevant part of the error is that the do_node_execute doesn't have an async version. It's definitely on our roadmap and we note your interest!

@zilto zilto added enhancement New feature or request async labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants