Hi,
one of our customers created a feature class in ArcGIS Pro in the default GDB. He configured an attribute domain with 3 values and assigned it to a specific column in the feature class.
When he is editing the feature class in ArcGIS Pro manually, the customer can only choose between the 3 given values (expected behaviour). On the other hand when the customer ist using the arcpy.da.InsertCursor(...) on this dataset and the specific column, he can write any value into the column. Isn't that against the idea of a domain?
Here are some screenshots:#
(1) manually:
(2) cursor:
Best
Sven
It could be that domains through arcpy.da are readonly
Domain—ArcGIS Pro | Documentation
but can be created and managed through arctoolbox
Add Coded Value To Domain (Data Management)—ArcGIS Pro | Documentation
and there doesn't appear to be any supported environments setting to limit control when used with cursors.
Maybe this is an advantage since you could technically add values without needing to recreate them (haven't tested this... give it a try if you have a sample dataset)
Good question - I had the same reaction when I first ran into this. I'm not a database expert but I believe SQL server has the ability to constrain a column to a set of values so I'm curious why this isn't enforced.