laptop and a wrench

不具合

The arcpy.FieldMap or arcpy.FieldMappings object, or both fail to handle a date field in ArcGIS Pro 3.x. Dates are not populated in the appropriate field.

ArcGIS Pro
不具合 ID 番号 BUG-000161939
送信されましたOctober 6, 2023
最終更新日June 5, 2024
適用対象ArcGIS Pro
見つかったバージョン3.1
オペレーティング システムWindows OS
オペレーティング システムのバージョン10.0
ステータスDuplicate

対処法

The best practice for using the arcpy.FieldMapping() and arcpy.FieldMappings() objects is to construct the field mapping by adding the target and input dataset fields using addTable first. The following code snippet produced the expected output for the provided script:

... 
try:
    ## Truncate the staging table
    ap.TruncateTable_management(tblCntyDataStaging)
    ## Run the arcpy fieldmapper to map field name changes between the two schemas
    fms = arcpy.FieldMappings()
    
    ### Use addTable for target and input per best practices
    fms.addTable(tblCntyDataStaging)
    fms.addTable(tblCntyDataSource)
    ###
    for field in fieldList_cds:
        if field.name != "OBJECTID":
            fm = arcpy.FieldMap()
            fm.addInputField(tblCntyDataSource, field.name)
            f_out = fm.outputField
            f_out.name = fieldMapDict_cd[field.name]
            f_out.type = field.type
            fm.outputField = f_out
            fms.addFieldMap(fm)
    # Populate the fresh table into the staging table
    arcpy.Append_management(
         tblCntyDataSource, tblCntyDataStaging, "NO_TEST", field_mapping=fms
     )
...

再現の手順

不具合 ID: BUG-000161939

ソフトウェア:

  • ArcGIS Pro

バグのステータスが変更されたときに通知を受け取る

Esri Support アプリのダウンロード

このトピックについてさらに調べる

ArcGIS エキスパートのサポートを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動