Skip to content

support NULL passed through literal_processor #10535

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

Closed
zzzeek opened this issue Oct 24, 2023 · 2 comments
Closed

support NULL passed through literal_processor #10535

zzzeek opened this issue Oct 24, 2023 · 2 comments
Labels
bug Something isn't working datatypes things to do with database types, like VARCHAR and others
Milestone

Comments

@zzzeek
Copy link
Member

zzzeek commented Oct 24, 2023

right now a None value that's passed through the compiler for literal_processor() is passed in, and none of the handlers expect None and just return None, where the compiler then renders nothing.

Changes should be as follows:

  1. the compiler, when it sees the value is None, returns the string NULL or otherwise uses a render_null() method of some kind; it does not send the data to the literal_processor() for the type, unless should_evaluate_none on the type is set
  2. all the types that have literal_processor() and do not have "should_evaluate_none" can assume the value passed is non None
  3. tests for JSON/JSONB doing "evaluate none" style tests should be added; the base test_literal_round_trip() suite should do a NULL round trip for all datatypes

this could be a 2.0 thing or a 2.1 thing

@zzzeek zzzeek added bug Something isn't working datatypes things to do with database types, like VARCHAR and others labels Oct 24, 2023
@zzzeek zzzeek added this to the 2.1 milestone Oct 24, 2023
@zzzeek
Copy link
Member Author

zzzeek commented Oct 24, 2023

since I'm tryring to do #9737 let's just do it

@sqla-tester
Copy link
Collaborator

Mike Bayer has proposed a fix for this issue in the main branch:

accommodate NULL at the compiler level for literal_render https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/4937

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working datatypes things to do with database types, like VARCHAR and others
Projects
None yet
Development

No branches or pull requests

2 participants