duckdb / duckdb/duckdb-python

Failure to collect operations that join two lazily retrieved Polars lazyframes

Ouverte
#583 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
needs triage
Langage dominant
Python
Étoiles
187
Forks
112
Merge moyen
13 h 29 min
PR mergées (30 j)
17

Description

### What happens?

I have downstream functions that expect multiple `polars.LazyFrame` objects. In my upstream code, I want to source my data from DuckDB to enable efficient pushdown. However, using `DuckDBPyRelation.pl(lazy=True)` raises a `ComputeError` when operating on multiple `LazyFrame` objects.

### To Reproduce

```python
import duckdb

with duckdb.connect() as con:
con.sql("CREATE TABLE tbl (t1 INTEGER)")
con.sql("CREATE TABLE tbl2 (t1 INTEGER)")

# Retrieve the results
rel = con.table("tbl").pl(lazy=True)
rel2 = con.table("tbl2").pl(lazy=True)

# Compute and raise the error
df = rel.join(rel2, on="t1", how="inner").collect()
```

the block above raises

```
ComputeError: caught exception during execution of a Python source, exception: InvalidInputException: Invalid Input Error: Attempting to execute an unsuccessful or closed pending query result
```

### OS:

Linux - aarch64

### DuckDB Package Version:

1.5.5

### Python Version:

3.12

### Full Name:

Akshay Gupta

### Affiliation:

Capital One

### What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

### Did you include all relevant data sets for reproducing the issue?

Yes

### Did you include all code required to reproduce the issue?

- [x] Yes, I have

### Did you include all relevant configuration to reproduce the issue?

- [x] Yes, I have

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par DuckDBPyRelation.pl(lazy=True) et reproduisez l’échec avec les deux relations jointes via Polars, puis suivez le chemin d’exécution jusqu’à rel.join(...).collect(). C’est terminé lorsque l’exemple fourni s’exécute correctement et renvoie le résultat joint sans ComputeError.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
databases
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
68/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.