question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python None should be converted to 'NULL' instead of 'null'

See original GitHub issue

Very low priority ticket for neatness, it would be nice if Python None converted to ‘NULL’ instead of ‘null’

str(Query.from_('testtable').select(None))
'SELECT null FROM "testtable"'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
spinningarrowcommented, Aug 7, 2017

No worries - I found it. It’s the isnull method. Doing table.my_column.isnull() works.

0reactions
MartinThomacommented, Jun 3, 2020

How do you deal with missing columns for UNION ALL in Pypika?

In standard SQL, you just supply a NULL column (example).

Field("NULL") seems to do the trick in pypika, but Field(None) throws an error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null in Python: Understanding Python's NoneType Object
Python uses the keyword None to define null objects and variables. While None does serve some of the same purposes as null in...
Read more >
set null to None in Python, is it a good practice? - Stack Overflow
Any code you write should use None , not a variable set to None . Having a null constant wouldn't help because you...
Read more >
Python Null or None Object with Example - STechies
In python, the None keyword is used to define the Null value of an object or variable; it is an object and a...
Read more >
Python | Convert None to empty string - GeeksforGeeks
Simply the str function can be used to perform this particular task because, None also evaluates to a “False” value and hence will...
Read more >
What is the difference between Null and empty string in Python?
Null is NoneType in Python. It means nothing. There is nothing. You cannot operate on “None” or Null stuff. Trying to add anything...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found