I'm using ArcGIS Pro 3.1.2. Calling TableToNumPyArray or FeatureClassToNumPyArray creates a schema lock on the File Geodatabase containing the feature class or table used as input to the function when the code is executed in a Jupyter Notebook in a standalone environment. It also creates a schema lock when executed via a standalone Python window. This does not happen when the code is executed from a Jupyter Notebook run inside of ArcGIS Pro, or from the Python Console in ArcGIS Pro. The only method I found for releasing the schema lock is restarting the Kernel or exiting Python in the standalone window.
This seems like a bug since it doesn't occur when the code is executed inside Pro. Is there a way to release the schema lock that is unadvertised?
Provide a path to your data and a valid field name and the code below will produce locks in your geodatabase when executed in Jupyter Notebooks outside of Pro.
import arcpy
import numpy
tbl = r"path to your table here"
fld = "a field in your table"
nulls_bool = False # Tested with both True and False, doesn't matter
arr = arcpy.da.TableToNumPyArray(tbl, fld, skip_nulls=nulls_bool)