kosiew commented on code in PR #1587:
URL: 
https://github.com/apache/datafusion-python/pull/1587#discussion_r3407788571


##########
python/tests/test_functions.py:
##########
@@ -2160,16 +2161,51 @@ def test_date_part_native_str(self):
         ctx = SessionContext()
         df = ctx.from_pydict({"a": ["2021-07-15T00:00:00"]})
         df = df.select(f.to_timestamp(column("a")).alias("a"))
-        result = df.select(f.date_part("year", 
column("a")).alias("y")).collect()
+        with warnings.catch_warnings():
+            warnings.simplefilter("error", DeprecationWarning)
+            result = df.select(f.date_part("year", 
column("a")).alias("y")).collect()

Review Comment:
   We do need to assert that native string input emits no `DeprecationWarning`, 
but I agree that we do not need to execute the full dataframe to prove that. 
The warning is emitted at expression construction time.
   I'll simplify this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to