<?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>topic Python script crashing in SAS Viya when querying a large dataset in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969340#M2888</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to query data in SAS Viya using a python script. I am able to connect to my CAS Library using the&amp;nbsp;swat.CAS() function. When trying to load a large dataset (~10GB) my python program ends up crashing with the following error message:&lt;BR /&gt;&lt;EM&gt;raise SWATError('Unable to connect to any URL in the list: %s' %&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;swat.exceptions.SWATError: Unable to connect to any URL in the list:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried querying smaller datasets and i'm able to run my python script with no issues. Is there a way around this, please advise.&amp;nbsp;Thank you!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jun 2025 21:27:54 GMT</pubDate>
    <dc:creator>mk1804</dc:creator>
    <dc:date>2025-06-18T21:27:54Z</dc:date>
    <item>
      <title>Python script crashing in SAS Viya when querying a large dataset</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969340#M2888</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to query data in SAS Viya using a python script. I am able to connect to my CAS Library using the&amp;nbsp;swat.CAS() function. When trying to load a large dataset (~10GB) my python program ends up crashing with the following error message:&lt;BR /&gt;&lt;EM&gt;raise SWATError('Unable to connect to any URL in the list: %s' %&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;swat.exceptions.SWATError: Unable to connect to any URL in the list:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried querying smaller datasets and i'm able to run my python script with no issues. Is there a way around this, please advise.&amp;nbsp;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2025 21:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969340#M2888</guid>
      <dc:creator>mk1804</dc:creator>
      <dc:date>2025-06-18T21:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Python script crashing in SAS Viya when querying a large dataset</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969361#M2889</link>
      <description>&lt;P&gt;Without really knowing my first assumption is insufficient memory. Not sure if there is a way that can get you more memory for your session. Something to ask your SAS admin.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And as a test: Run a python script that does nothing else than reading the data into python. If this works then you could investigate where your current script consumes additional memory and if there are options to reduce its hunger.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 11:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969361#M2889</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2025-06-19T11:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Python script crashing in SAS Viya when querying a large dataset</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969433#M2894</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/473633"&gt;@mk1804&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing to keep in mind is Viya SWAT package functions would return/send Pandas "Dataframe" object, well it's SASDataFrame which is a subclass of pandas.DataFrame to your Python process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;Without knowing which version of the SWAT package you are using, the &lt;A href="https://sassoftware.github.io/python-swat/table-vs-dataframe.html?highlight=to_frame" target="_self"&gt;SWAT docs&lt;/A&gt; indicates pandas.DataFrame v 0.192.2&amp;nbsp;being used!&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, I would highly recommend you look into techniques/ways to reduce your pandas DataFrame memory footprint.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sparkcodehub.com/pandas/advanced/memory-usage-guide" target="_blank"&gt;https://www.sparkcodehub.com/pandas/advanced/memory-usage-guide&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are additional resources that might be of use to you and other readers&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sgf/2020/06/19/getting-started-with-python-integration-to-sas-viya-part-2-working-with-cas-actions-and-casresults-objects/" target="_blank"&gt;Getting Started with Python Integration to SAS® Viya® - Part 2 - Working with CAS Actions and CASResults Objects&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sgf/2023/02/13/getting-started-with-python-integration-to-sas-viya-part-14-cas-table-to-dataframe/" target="_blank"&gt;Getting Started with Python Integration to SAS® Viya® - Part 14 - CAS Table to DataFrame&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Ahmed&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2025 13:12:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969433#M2894</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2025-06-20T13:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Python script crashing in SAS Viya when querying a large dataset</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969645#M2896</link>
      <description>&lt;P&gt;Hi Patrick,&amp;nbsp;&lt;BR /&gt;Thank you for your reply. I am able to read data using my script if its a smaller table, i'm running into issues when it comes to larger tables. I'll reach out to my SAS admin regarding the memory, thanks!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 00:52:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969645#M2896</guid>
      <dc:creator>mk1804</dc:creator>
      <dc:date>2025-06-25T00:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Python script crashing in SAS Viya when querying a large dataset</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969646#M2897</link>
      <description>&lt;P&gt;Thank you Ahmed - will take a look at the links!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 00:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Python-script-crashing-in-SAS-Viya-when-querying-a-large-dataset/m-p/969646#M2897</guid>
      <dc:creator>mk1804</dc:creator>
      <dc:date>2025-06-25T00:54:27Z</dc:date>
    </item>
  </channel>
</rss>

