Select to view content in your preferred language

Arcpy error 000278 field mapping issue for date field

1375
1
Jump to solution
11-22-2018 12:50 PM
GISOfficer
Frequent Contributor

I have been having the same issue as described at the following threads,with a date field being flagged as invalid in a feature class to feature class conversion:

 

Date Field Conflict w Feature Class to Feature Class Conversion via Arcpy 

 

arcpy - Field Type Date invalid when run in Python, but not in Model? - Geographic Information Syste... 

 

I have tried the Stack Exchange workaround (second link above) in going via a temporary file geodatabase/feature class, but when trying to then transfer that into my intended destination I still get the same error.

Code line is as follows, N.B. I did not write this script and am not sure when it was first authored:

Int_fields="""Interment_ID "Interment ID" true true false 12 Long 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Record_ID,-1,-1;Interment_Type "Interment Type" true true false 20 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Grave_Ashes,-1,-1;Plot_ID "Plot ID" true true false 20 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Cemetery_Code,-1,-1;Surname "Surname" true true false 50 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Family_Name,-1,-1;Given_Names "Given Names" true true false 50 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Given_Names,-1,-1;Full_Name "Full Name" true true false 50 Text 0 0 ,First,"#""" + flInt + """,""" + IntM2 + """.Given_Names",FL_Interments_with_geometry,T_ce_view_plot_interments.Family_Name,-1,-1;Age "Age" true true false 20 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Age,-1,-1;Age_Type "Age Type" true true false 10 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Age_Type,-1,-1;Date_Deceased "Date Deceased" true true false 8 Date 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Date_Deceased,-1,-1;Date_Interred "Date Interred" true true false 8 Date 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Internment_Date,-1,-1;Occupation "Occupation" true true false 60 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Occupation,-1,-1;Place_Origin "Place of Origin" true true false 25 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Nationality,-1,-1;Funeral_Director "Funeral Director" true true false 60 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Funeral_Director,-1,-1;Clergyman "Clergyman" true true false 50 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Clergyman,-1,-1;Denomination "Denomination" true true false 60 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Denomination,-1,-1;Purchaser "Purchaser" true true false 50 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Purchaser,-1,-1;Purchase_Date "Purchase Date" true true false 8 Date 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Purchase_Date,-1,-1;Headstone_Inscription "Headstone Inscription" true true false 1000 Text 0 0 ,First,#,""" + flInt + """,""" + IntM2 + """.Headstone_Inscription,-1,-1"""


arcpy.FeatureClassToFeatureClass_conversion(in_features=flInt, out_path=ws,
out_name=Int2, field_mapping=Int_fields)

 

My error messages are below:

 

PYTHON ERRORS:

Traceback info:

  File "D:\ArcGIS\Tools\Python scripts\Cemeteries_Updater.py", line 179, in <module>

    out_name=Int2, field_mapping=Int_fields)

 

Error Info:

ERROR 000278: Field mapping error: field type invalid for output field Date_Interred and input field T_ce_view_plot_interments.Internment_Date

Failed to execute (FeatureClassToFeatureClass).

 

ArcPy ERRORS:

ERROR 000278: Field mapping error: field type invalid for output field Date_Interred and input field T_ce_view_plot_interments.Internment_Date

Failed to execute (FeatureClassToFeatureClass).

 

I'm unable to share source data but just looking for ideas on solutions/workarounds to convert a SQL view into a file geodatabase feature class and brig a date field across successfully.  This started happening 3 weeks ago, and I am aware of no changes that we made to either our ArcGIS install or databases/feature classes/fields.  It just seemed to start happening.

I have tried importing this into a model builder model and running it that way, but still get the same error.

0 Kudos
1 Solution

Accepted Solutions
GISOfficer
Frequent Contributor

This looks like a field typo, we had corrected the field T_ce_view_plot_interments.Internment_Date (note the 'Intern' rather than 'Inter') so the script appears to have been looking for a field that didn't exist.  It didn't error out on not finding the input field, but instead threw the error above.

Yes, that was it.  Problem solved.

View solution in original post

0 Kudos
1 Reply
GISOfficer
Frequent Contributor

This looks like a field typo, we had corrected the field T_ce_view_plot_interments.Internment_Date (note the 'Intern' rather than 'Inter') so the script appears to have been looking for a field that didn't exist.  It didn't error out on not finding the input field, but instead threw the error above.

Yes, that was it.  Problem solved.

0 Kudos