Skip to content

Commit baf4769

Browse files
timsaucerclaude
andcommitted
docs(spark): use isoformat in spark_cast doctest
pyarrow tzinfo repr differs across versions (<UTC> vs zoneinfo.ZoneInfo(key='UTC')), breaking the doctest on some platforms. isoformat is stable across versions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d9c8da9 commit baf4769

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

python/datafusion/functions/spark.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ def spark_cast(arg: Expr, type_str: Expr) -> Expr:
459459
... dfn.lit(1579098645), dfn.lit("timestamp")
460460
... ).alias("v")
461461
... )
462-
>>> r.collect_column("v")[0].as_py()
463-
datetime.datetime(2020, 1, 15, 14, 30, 45, tzinfo=<UTC>)
462+
>>> r.collect_column("v")[0].as_py().isoformat()
463+
'2020-01-15T14:30:45+00:00'
464464
"""
465465
return Expr(_f.spark_cast(arg.expr, type_str.expr))
466466

0 commit comments

Comments
 (0)