
I appear to be having an issue similar to that reported by @Hieye Rowe here some time ago:
whereby dates are being shifted to one day earlier when being passed from TabPy back to Tableau Prep (although for me the issue is random, some dates do appear to be passed correctly).
In my Python code I have the following debug line immediately prior to the "return" line, where I return a list of "Calendar Dates" against a specific "Change Reference":
print(output_change_df.query('`Change Reference` == "ea485542-131a-4b42-bdcf-6e08b4674198"')['Calendar Date'])
return(output_change_df)
This yields the following:
33 2024-04-26
34 2024-04-27
35 2024-04-28
36 2024-04-29
as I would expect (this change spans these four dates).
However, back in Tableau I see the following:
All dates one day early.
To try and prove this as an issue, I created a very simple data source, containing a list of dates in April only in the format YYYY-MM-DD (attached "Date Bug Test").
I pass this to the simple flow attached date_bug_test.tfl
The Python code being run is the following:
def date_bug_test(input_df):
return input_df
def get_output_schema():
return pd.DataFrame({
'Shipment Date': prep_date()
})
The output file is also attached (date_bug_test_output) - all dates are one day earlier.
I believe I am running the latest version of Prep (2024.1.0) and TabPy (2.9.0).
Thanks in advance.