We created an expression in field calculator that concatenates individual components of an address into a full address field. When I fill the code block and hit Apply, the output is what I would expect. When my coworker performs the same actions, his results have additional spaces and not in any recognizable pattern. Randomly, there will be extra spaces before and after various bits of the address. After a while of investigating the differences in our actions and environments, we realized that he is running the script against a feature class in an enterprise database while I was testing it on an exported shapefile of that feature class. Aside from that, the code is the same, the tables are the same in terms of data type, precision, etc., and we are both using ArcGIS Pro. The script works as intended on a shapefile but adds spaces when run on a feature class in a database.
Example -
When I run the script on the shapefile, I get "1984 MONKEY DR BLDG A FL 2 UNIT 26"
When he runs the script on the feature class, he gets "1984 MONKEY DR BLDG A FL 2 UNIT 26" with extra spaces
Does anyone know what could be causing this? I've included a screenshot of the field calculator.