apache / apache/hamilton

Async support for `PDBDebugger`

Open
#1,201 1 comment 0 reactions 0 assignees View on GitHub
async enhancement
Dominant language
Jupyter Notebook
Stars
2.6k
Forks
213
PR merge metrics
No merged PRs in 30d

Description

**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()`.

```python
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.

```python
.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: []`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.