Skip to content

Instantly share code, notes, and snippets.

@ben-nour
Created March 12, 2025 23:26
Show Gist options
  • Save ben-nour/98e8dd1ebf262af88b0cc0f9ea75ac24 to your computer and use it in GitHub Desktop.
Save ben-nour/98e8dd1ebf262af88b0cc0f9ea75ac24 to your computer and use it in GitHub Desktop.
How to insert None objects into a Snowflake table's numeric column.
import snowflake.connector
value = None
# Won't work:
f"""INSERT INTO example_table(
visitors
) VALUES
(
'{value}',
)
"""
# Works:
f"""INSERT INTO example_table(
visitors
) VALUES
(
TRY_TO_NUMBER('{value}'),
)
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment