<?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 ArcGIS Pro v 3.0.0 and changes to python? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-v-3-0-0-and-changes-to-python/m-p/1215206#M60134</link>
    <description>&lt;P&gt;Hi -&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of my users contacted me because a python script he is running has started giving him some issues after our organization pushed Pro version 3.0.0 to our workstations. His script (below) is exporting a feature layer to a CSV, which is then being pulled into R for further analysis. Previously, the CSV would export and any null values in the attribute table would just be blank/empty. Now, they are all coded to "None" which has thrown off his processes in R. He added logic into the R script to deal with these new "None" values, however I was curious if there was some kind of change at Pro version 3.0.0 which could have caused this. His Py script had been updated to Python 3 awhile ago and was running fine. We are uncertain what the problem could be, but the issues started happening right around when we upgraded ArcGIS Pro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also notice that if I go to the hosted feature layer in ArcGIS Online and export to a CSV from the Item Details page, null values are empty and not coded as "None". Same if I view the feature layer in AGOL or Pro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on what could be causing this would be appreciated.&lt;/P&gt;&lt;P&gt;Here is the Python script:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#!C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3 python
# coding: utf-8
# In[60]:
import arcgis
from arcgis.gis import GIS
from arcgis.gis import *
import os
import getpass

portal_url = rhttps://mass-eoeea.maps.arcgis.com/
# ArcGIS user credentials to authenticate against the portal
username = 'USERNAME'
password = 'PASSWORD'
gis = GIS(portal_url, username, password)
          
# ID of the feature service you want to export
featureServiceID = "0d081b35bbe2466290926f0f09faffe5"

# Get username
username = getpass.getuser()

# Output format  Shapefile | CSV | File Geodatabase
out_format = 'CSV'
# Local folder where the data will be downloaded (include slash at the end)
download_folder = "C:\\Users\\" + username + PATH
# Address of your ArcGIS portal
portal_url = rhttps://mass-eoeea.maps.arcgis.com/

download_file = download_folder + 'download.zip'

       
# ID of Field Data
item_id = featureServiceID
filename = "stage_turbidity" + "." + out_format
outpath = download_folder + filename
          
# Get content and save to csv
my_item = gis.content.get(item_id)
my_layer = my_item.tables[0].query().sdf
my_layer.to_csv(outpath, index = False)

#Download photos
download_folder_photos = download_folder + "Photos\\"

#Query to get list of object ids in layer
featureLayer = my_item.tables[0]
featureObjectIds = featureLayer.query(where='1=1', return_ids_only=True)

#Loop through features in layer
emptyAttachments = 0
for j in range(len(featureObjectIds['objectIds'])):
    currentObjectId = featureObjectIds['objectIds'][j]
    currentObjectIdAttachments = featureLayer.attachments.get_list(oid=currentObjectId)
    if len(currentObjectIdAttachments) &amp;gt; 0:
        
#Loop through feature attachments and download to appropriate folder
        for k in range(len(currentObjectIdAttachments)):
            attachmentId = currentObjectIdAttachments[k]['id']
            attachmentName = currentObjectIdAttachments[k]['name']
            attachmentParentId = currentObjectIdAttachments[k]['parentGlobalId']
            
            FileName = '{}'.format(attachmentName)
            AttachmentPath = '{}\\{}'.format(download_folder_photos, FileName)
            FinalFileName = '{}.{}'.format(attachmentParentId,"jpg")
            FinalAttachmentPath = '{}\\{}'.format(download_folder_photos, FinalFileName)
            if not os.path.isfile(FinalAttachmentPath):
                featureLayer.attachments.download(oid=currentObjectId, attachment_id=attachmentId, save_path=download_folder_photos)
                os.rename(AttachmentPath, FinalAttachmentPath)

print("Finished downloading csv file.")

# Run batch file to process csv outputs and import into Database
file = "C:\\Users\\" + username + PATH.bat
os.system('"' + file + '"')
print ("Stage/Turbdiity Data Processed with R Script" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2022 18:17:08 GMT</pubDate>
    <dc:creator>erica_poisson</dc:creator>
    <dc:date>2022-09-22T18:17:08Z</dc:date>
    <item>
      <title>ArcGIS Pro v 3.0.0 and changes to python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-v-3-0-0-and-changes-to-python/m-p/1215206#M60134</link>
      <description>&lt;P&gt;Hi -&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of my users contacted me because a python script he is running has started giving him some issues after our organization pushed Pro version 3.0.0 to our workstations. His script (below) is exporting a feature layer to a CSV, which is then being pulled into R for further analysis. Previously, the CSV would export and any null values in the attribute table would just be blank/empty. Now, they are all coded to "None" which has thrown off his processes in R. He added logic into the R script to deal with these new "None" values, however I was curious if there was some kind of change at Pro version 3.0.0 which could have caused this. His Py script had been updated to Python 3 awhile ago and was running fine. We are uncertain what the problem could be, but the issues started happening right around when we upgraded ArcGIS Pro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also notice that if I go to the hosted feature layer in ArcGIS Online and export to a CSV from the Item Details page, null values are empty and not coded as "None". Same if I view the feature layer in AGOL or Pro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on what could be causing this would be appreciated.&lt;/P&gt;&lt;P&gt;Here is the Python script:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#!C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3 python
# coding: utf-8
# In[60]:
import arcgis
from arcgis.gis import GIS
from arcgis.gis import *
import os
import getpass

portal_url = rhttps://mass-eoeea.maps.arcgis.com/
# ArcGIS user credentials to authenticate against the portal
username = 'USERNAME'
password = 'PASSWORD'
gis = GIS(portal_url, username, password)
          
# ID of the feature service you want to export
featureServiceID = "0d081b35bbe2466290926f0f09faffe5"

# Get username
username = getpass.getuser()

# Output format  Shapefile | CSV | File Geodatabase
out_format = 'CSV'
# Local folder where the data will be downloaded (include slash at the end)
download_folder = "C:\\Users\\" + username + PATH
# Address of your ArcGIS portal
portal_url = rhttps://mass-eoeea.maps.arcgis.com/

download_file = download_folder + 'download.zip'

       
# ID of Field Data
item_id = featureServiceID
filename = "stage_turbidity" + "." + out_format
outpath = download_folder + filename
          
# Get content and save to csv
my_item = gis.content.get(item_id)
my_layer = my_item.tables[0].query().sdf
my_layer.to_csv(outpath, index = False)

#Download photos
download_folder_photos = download_folder + "Photos\\"

#Query to get list of object ids in layer
featureLayer = my_item.tables[0]
featureObjectIds = featureLayer.query(where='1=1', return_ids_only=True)

#Loop through features in layer
emptyAttachments = 0
for j in range(len(featureObjectIds['objectIds'])):
    currentObjectId = featureObjectIds['objectIds'][j]
    currentObjectIdAttachments = featureLayer.attachments.get_list(oid=currentObjectId)
    if len(currentObjectIdAttachments) &amp;gt; 0:
        
#Loop through feature attachments and download to appropriate folder
        for k in range(len(currentObjectIdAttachments)):
            attachmentId = currentObjectIdAttachments[k]['id']
            attachmentName = currentObjectIdAttachments[k]['name']
            attachmentParentId = currentObjectIdAttachments[k]['parentGlobalId']
            
            FileName = '{}'.format(attachmentName)
            AttachmentPath = '{}\\{}'.format(download_folder_photos, FileName)
            FinalFileName = '{}.{}'.format(attachmentParentId,"jpg")
            FinalAttachmentPath = '{}\\{}'.format(download_folder_photos, FinalFileName)
            if not os.path.isfile(FinalAttachmentPath):
                featureLayer.attachments.download(oid=currentObjectId, attachment_id=attachmentId, save_path=download_folder_photos)
                os.rename(AttachmentPath, FinalAttachmentPath)

print("Finished downloading csv file.")

# Run batch file to process csv outputs and import into Database
file = "C:\\Users\\" + username + PATH.bat
os.system('"' + file + '"')
print ("Stage/Turbdiity Data Processed with R Script" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 18:17:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-v-3-0-0-and-changes-to-python/m-p/1215206#M60134</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2022-09-22T18:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro v 3.0.0 and changes to python?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-v-3-0-0-and-changes-to-python/m-p/1233074#M62390</link>
      <description>&lt;P&gt;I don't have much to contribute, other than that I noticed similar issues in the way ArcGIS Pro seems to handle/flag/calculate &amp;lt;Null&amp;gt;/None in an attribute table at the 3.0 version level.&lt;/P&gt;&lt;P&gt;When using the Field Calculator and Python as the parser, calculating a numeric or a text field back to "None" (without the quotes, of course) yields a new warning message that was not present in previous versions of the software (for this particular calculation back to "&amp;lt;Null&amp;gt;", anyway). Operation still works, but it seems to indicate to me that either: A) NULLs are being handled/read/recorded differently, or B) this is totally unrelated to your problem and it's just a friendly warning message they now provide for... some reason.&lt;/P&gt;&lt;P&gt;Here is my posted question about this, in case the answer provided buy&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2538"&gt;@Robert_LeClair&lt;/a&gt;&amp;nbsp;is of any help to you:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/calculating-quot-none-quot-using-field-calculator/m-p/1232853#M62368" target="_blank" rel="noopener"&gt;Solved: Re: Calculating "None" Using Field Calculator Yiel... - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 01:02:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-v-3-0-0-and-changes-to-python/m-p/1233074#M62390</guid>
      <dc:creator>VinceE</dc:creator>
      <dc:date>2022-11-18T01:02:40Z</dc:date>
    </item>
  </channel>
</rss>

