I am adding a hosted feature layer by zipping a file geodatabase, adding it using gis.content.add, then publishing the layer. I am then retrieving the layer using gis.content.search, getting the item, and then trying to use item.get_data(try_json=True). It is returning None, which from the documentation I can see says that 'Zero byte files will return None'. I am unsure why there is no data returning. I can add the layer to a map, display it, etc...but cannot get the data to return for the layer. Has anyone else dealt with this issue?
layer_title = <title>
url = "https://www.arcgis.com"
username = <username>
password = <password>
gis = GIS(url, username, password)
layer_properties = {'type': 'File Geodatabase', 'title': <title>}
#add file gdb
layer = gis.content.add(item_properties=layer_properties, data=outfile) # outfile is the zipped file gdb
#publish item
layer_item = layer.publish()
#delete zipped folder
layer.delete()
layer_search = gis.content.search("title: {}".format(layer_title), item_type="Feature Layer")
item = layer_search[0]
item_data = item.get_data(try_json=True)
print(item_data)