I am working on a script in Python to copy several Feature Classes hosted on ArcGIS Hub to a local fGDB. I am using the workflow provided by @JoshuaBixby in Using arcpy to copy a portal feature service to a fgdb feature class. This is working for most of the features but a few will have NULL values listed for their Shape_Length and Shape_Area once imported into the fGDB. Some features do not add these fields while others populate without issue. Any Idea as to how to resolve the Null values.
import arcpy
from arcgis.features import FeatureLayer
url_fl = r"https://the.url.com/arcgis/rest/services/structures/MapServer/0"
fgdb = r'c:\pathTo\mytest.gdb'
fc = r'thisfeature'
fl = FeatureLayer(url_fl)
fs = fl.query()
fs.save(fgdb, fc)
I do not own the data hosted on the Hub but have been given access to download/query the data. If I use the Feature Class to Feature Class tool in ArcGIS Pro the Shape_Length and Shape_Area fields populate, without issue.