Skip to content

Conversation

Tishj
Copy link
Contributor

@Tishj Tishj commented Sep 12, 2024

This PR fixes #13836

Using con.execute("set python_scan_all_frames=true") we will scan all frames again when performing a replacement scan.
Meaning that if df is not defined in the current scope, but it is defined in the previous scope (or deeper), then it will still be found if this setting is flipped to true.

@Mytherin Mytherin merged commit 7dbdcdc into duckdb:main Sep 12, 2024
15 checks passed
@Mytherin
Copy link
Collaborator

Thanks!

@Alex-Monahan
Copy link
Contributor

Howdy @Tishj! Would it be possible to set python_scan_all_frames to default to true? I think that would fully restore the prior behavior. Or is there an issue with the prior behavior in some way?

Thanks!

@Tishj
Copy link
Contributor Author

Tishj commented Sep 18, 2024

Howdy @Tishj! Would it be possible to set python_scan_all_frames to default to true? I think that would fully restore the prior behavior. Or is there an issue with the prior behavior in some way?

Thanks!

I don't think that's desired behavior in all cases, it feels much more sane to follow python's variable lookup logic here than to automatically dig through all frames.
The issue that inspired this change is this one: #11687

@Alex-Monahan
Copy link
Contributor

Howdy @Tishj! Would it be possible to set python_scan_all_frames to default to true? I think that would fully restore the prior behavior. Or is there an issue with the prior behavior in some way?
Thanks!

I don't think that's desired behavior in all cases, it feels much more sane to follow python's variable lookup logic here than to automatically dig through all frames. The issue that inspired this change is this one: #11687

Makes sense! I agree, isolating in the same way that Python isolates is the best way. I think the JupySQL issue might be that they were stretching the bounds of what is recommended in some way. Thanks!

github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Sep 25, 2024
Improve error on enums (duckdb/duckdb#13885)
[Python] Add `python_scan_all_frames` to opt-in to scanning all frames (< 1.1 behavior) (duckdb/duckdb#13896)
github-actions bot added a commit to duckdb/duckdb-r that referenced this pull request Sep 25, 2024
Improve error on enums (duckdb/duckdb#13885)
[Python] Add `python_scan_all_frames` to opt-in to scanning all frames (< 1.1 behavior) (duckdb/duckdb#13896)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
@Tishj Tishj mentioned this pull request Nov 25, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eatoni v1.1.0 does not work with pandas API as it did earlier
3 participants