<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Invalid datetime value when using Python Script in Da... in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711421#M4830573</link>
    <description>&lt;P&gt;---&lt;/P&gt;</description>
    <pubDate>Fri, 24 May 2024 05:00:30 GMT</pubDate>
    <dc:creator>_Markus_</dc:creator>
    <dc:date>2024-05-24T05:00:30Z</dc:date>
    <item>
      <title>Invalid datetime value when using Python Script in Datasphere</title>
      <link>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaq-p/13710779</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am still relatively new to the Datasphere and am currently familiarizing myself with Python scripts for data transformation. I am encountering a problem in the mapping, which does not occur without a Python script with pure mapping of field in Datasphere.&lt;/P&gt;&lt;P&gt;My source has 56 fields, which should be extended by 2 additional calculated fields. If I write the data 1:1 (without script) into a target table, the data transformation works. As soon as the script is inserted and the data are passed through the script, the following error message appears:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarkusA_0-1716464699270.png" style="width: 999px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/114834i72FF63EBCC5331C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="MarkusA_0-1716464699270.png" alt="MarkusA_0-1716464699270.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I cannot identify from the error message which column is causing the problem. Is there any way to identify it, or do I have to extend the dataflow column by column and deploy and run the script again and again to determine which column is causing the error?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 11:46:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaq-p/13710779</guid>
      <dc:creator>_Markus_</dc:creator>
      <dc:date>2024-05-23T11:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid datetime value when using Python Script in Datasphere</title>
      <link>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711170#M4830549</link>
      <description>Hi Markus. From what I can read it fails at the filed which Python transformation (using Pandas package) assumes should be a valid date-time. Instead it seems to receive some date from Jan 1st, Year 1.</description>
      <pubDate>Thu, 23 May 2024 20:35:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711170#M4830549</guid>
      <dc:creator>Vitaliy-R</dc:creator>
      <dc:date>2024-05-23T20:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid datetime value when using Python Script in Da...</title>
      <link>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711421#M4830573</link>
      <description>&lt;P&gt;---&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 05:00:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711421#M4830573</guid>
      <dc:creator>_Markus_</dc:creator>
      <dc:date>2024-05-24T05:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid datetime value when using Python Script in Datasphere</title>
      <link>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711422#M4830574</link>
      <description>Hey Vitaly, thanks for your reply. Your assumption is correct. I've a look to the SQL-View on the source system and found the (AS400) timestamp column, which allows a value '0001-01-01'. I didn't thought about this way yesterday. But I wonder if there would be an easy way to find the related column from datasphere view. Is somewhere a logfile where I could find the column information causing this issue?</description>
      <pubDate>Fri, 24 May 2024 05:00:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711422#M4830574</guid>
      <dc:creator>_Markus_</dc:creator>
      <dc:date>2024-05-24T05:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid datetime value when using Python Script in Datasphere</title>
      <link>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711439#M4830578</link>
      <description>And then I have the question of how to deal with the fact that the input value is valid in SQL / Datasphere-Native, but not in Pandas. The error occurs when the script is called. This means that I have no way of checking the date field within the script and correcting it if necessary. So the only option is to avoid the script in the dataflow or to change possible invalid values in calculated columns beforehand. Or am I missing something? Translated with DeepL.com (free version)</description>
      <pubDate>Fri, 24 May 2024 05:27:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711439#M4830578</guid>
      <dc:creator>_Markus_</dc:creator>
      <dc:date>2024-05-24T05:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid datetime value when using Python Script in Da...</title>
      <link>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711509#M4830592</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First, the issue is caused by some invalid datatime value, you just need to check the related columns. it's not very convenient to debug the Python script in Datashpere, you can try to debug it in other applications, like Jupyter Notebook, with some sample data.&lt;/P&gt;&lt;P&gt;Second, you can try some other node to extend the columns you want if it's possible.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 06:45:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13711509#M4830592</guid>
      <dc:creator>Simon_Ye</dc:creator>
      <dc:date>2024-05-24T06:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid datetime value when using Python Script in Datasphere</title>
      <link>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13712877#M4830792</link>
      <description>Hey Simon, thanks for your idea. I hadn't even thought about the Jupyter notebook. I'll give that a try. However, after further research, it seems to me that the problem lies in an incompatibility of the data type. In the source (AS400 database) there is a column of the data type "timestamp". If I use the Dataflow, the data from the remote table can be transferred to the local table without any problems. If I add a script without additional code (only "return data") to the Dataflow, the error message appears. The error therefore occurs regardless of the content of the Python script. The solution can therefore only be that I check all columns for possible incompatibilities before calling the Python script and before the dataflow reaches the script. Translated with DeepL.com (free version)</description>
      <pubDate>Mon, 27 May 2024 06:03:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13712877#M4830792</guid>
      <dc:creator>_Markus_</dc:creator>
      <dc:date>2024-05-27T06:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid datetime value when using Python Script in Da...</title>
      <link>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13712879#M4830793</link>
      <description>&lt;P&gt;Hey Simon,&lt;/P&gt;&lt;P&gt;thanks for your idea. I hadn't even thought about the Jupyter notebook. I'll give that a try.&lt;/P&gt;&lt;P&gt;However, after further research, it seems to me that the problem lies in an incompatibility of the data type. In the source (AS400 database) there is a column of the data type "timestamp". If I use the Dataflow, the data from the remote table can be transferred to the local table without any problems.&lt;BR /&gt;If I add a script without additional code (only "return data") to the Dataflow, the error message appears.&lt;BR /&gt;The error therefore occurs regardless of the content of the Python script.&lt;/P&gt;&lt;P&gt;The solution can therefore only be that I check all columns for possible incompatibilities before calling the Python script and before the dataflow reaches the script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 06:04:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/invalid-datetime-value-when-using-python-script-in-datasphere/qaa-p/13712879#M4830793</guid>
      <dc:creator>_Markus_</dc:creator>
      <dc:date>2024-05-27T06:04:01Z</dc:date>
    </item>
  </channel>
</rss>

