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

Drop Usage of ensureGil from PythonDeephavenSession and Copy Current Scope #5145

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

nbauernfeind
Copy link
Member

@nbauernfeind nbauernfeind commented Feb 12, 2024

Cleans up the toMap interface for use in other contexts (e.g. they want all Table instances) and Python copies currentScope instead of trying to do the work under the GIL.

Also fixes #5138 by only disallowing i, ii, k when used as formula parameters - allowing users to name tables in their REPL these things (and observe expected UI behavior).

Also fixes #2324 which is the java-reserved-keyword version of #5138.

@nbauernfeind nbauernfeind added query engine core Core development tasks NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed. labels Feb 12, 2024
@nbauernfeind nbauernfeind self-assigned this Feb 12, 2024
/**
* @return the current scope or the main globals if no scope is set
*/
PyDictWrapper currentScope();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this in the interface?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously we were using getKeysRaw (through delegation) and getEntriesRaw both of which created a Stream around iterating items in the currentScope. Now we must make a copy/dictCopy prior to using the returned values. (We were assuming that we could ensureGil while collecting keys and/or values, but this is not the case as performing these operations involve JNI.

I will remove the superfluous methods since I don't believe there is a good way to use them safely anymore.

engine/sql/src/main/java/io/deephaven/engine/sql/Sql.java Outdated Show resolved Hide resolved
@nbauernfeind nbauernfeind merged commit 8875f66 into deephaven:main Feb 17, 2024
19 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core Core development tasks NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed. query engine
Projects
None yet
2 participants