Skip to content

Commit 56bfeb6

Browse files
committed
Revert to old lit behavior
1 parent 4d29402 commit 56bfeb6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/snowflake/snowpark/functions.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def lit(
348348
``bool``, ``bytes``, ``bytearray``, ``datetime.time``, ``datetime.date``,
349349
``datetime.datetime`` and ``decimal.Decimal``. Also, it supports Python structured data types,
350350
including ``list``, ``tuple`` and ``dict``, but this container must
351-
be JSON serializable.
351+
be JSON serializable. If a ``Column`` is passed, it returns the column as is.
352352
353353
Example::
354354
@@ -366,9 +366,8 @@ def lit(
366366
<BLANKLINE>
367367
"""
368368

369-
assert not isinstance(
370-
literal, Column
371-
), "Do not use lit(Column(...)), type hint does not allow this syntax."
369+
if isinstance(literal, Column):
370+
return literal
372371

373372
ast = None
374373
if _emit_ast:

0 commit comments

Comments
 (0)