バージョン 7.1 にアップグレードする

このガイドでは、既存の Google Cloud Cortex Framework バージョン 7.0.x のデプロイをバージョン 7.1.0 にアップグレードする際に必要なバージョン固有の変更と対応が必要な移行アクションについて説明します。Cortex Framework をアップグレードするの標準ワークフローに沿って、次の手順を行います。/upgrade-cortex エージェント スキルを実行して、構成ファイルを自動的に検査して更新することもできます。

Python は 3.13(>=3.13,<3.14)のままです。バージョン 8.0 で削除が予定されている非推奨の項目については、Cortex Framework の非推奨をご覧ください。

次の表を使用して、デプロイに該当するセクションに切り替えます。

デプロイで使用しているもの 確認
バージョン 7.0.x のセットアップ 構成と CLI の変更
SAP ERP データ プロダクト SAP 列の互換性を破る変更と完全更新、動作の変更と孤立したオブジェクト
カスタム tableSettings オーバーライド カスタム table_settings.yaml の更新
カスタム モジュールまたは Python ビルダー カスタム データ プロダクトと Python ビルダーを移行する

構成と CLI の変更

これらの更新は、ビルド前のステップ 2: 構成、カスタム設定、拡張機能を更新するで適用します。

名前空間の検出

  • 組み込みの名前空間: 組み込みの data.namespaces エントリ(cortex、cortex_samples、cortex_v6_compatibility)では path を省略します(例: - name: cortex)。
  • 許可リストの動作: data.namespaces が設定されている場合、厳格な許可リストになりました(namespaces: [] はゼロの名前空間を有効にし、namespaces: null は検証に失敗します)。有効なモジュールが参照するすべての組み込み名前空間とローカル カスタム名前空間を一覧表示します。または、data.namespaces を省略して、インストールされているパッケージのみを自動検出します。

データ品質アサーション

  • デフォルトで有効(data.assertionsEnabled: true): Google Cloudプロジェクトを共有する場合は、デプロイごとに一意の data.defaultAssertionDataset を設定します(そうしないと、デフォルトの dataform_assertions データセットがデプロイ間で競合する可能性があります)。また、CI / CD で --create-datasets を uv run cortex-deploy に渡します。オプトアウトするには、data.assertionsEnabled: false を設定します。
  • 重大度タグ: data.assertionSeverities と data.defaultAssertionSeverity を一緒に構成するか、両方を省略します。

ターゲットとカタログの設定

  • 削除された type: generic ターゲット: type: generic エントリを削除するか、type: git に置き換えます(type: git には、targetSettings.authorEmail、グローバル git config user.email、または GIT_AUTHOR_EMAIL と GIT_COMMITTER_EMAIL の両方を使用した commit メールが必要です)。
  • セグメント全体の ignoredPaths 一致: type: dataform ターゲットで、targetSettings.ignoredPaths(デフォルトは ["definitions/custom"])が接頭辞ではなくパスセグメント全体に一致するようになりました。管理対象外のファイルを definitions/custom/ に移動するか、definitions/custom_* などのパスを ignoredPaths に追加して、uv run cortex-deploy が削除しないようにします。
  • カタログ tableSettings 許可リスト: 必要なすべてのソーステーブルがリストされるように、カタログ tableSettings ファイル (tables: / variants:)を更新します。

CLI の変更

バージョン 7.0.x バージョン 7.1
uv run cortex-build --create-datasets --create-datasets(および任意で -y / --yes)を uv run cortex-deploy または uv run cortex-build-and-deploy に渡します。
uv run cortex-deploy --assertions --assertions を uv run cortex-build または uv run cortex-build-and-deploy に渡します。
uv run cortex-kc-sync と --data-modules-root-directory uv run cortex-create-kc-data-products を使用し、data.namespaces で名前空間を宣言します。
uv run cortex-demo(SAP のみのデフォルト、snake_case フラグ) デフォルトは --sources all(7.0.x スコープを維持するには --sources sap を渡します)で、ダッシュケース フラグを使用します。uv run cortex-demo をご覧ください。

カスタム table_settings.yaml の更新

アップグレード全体でのカスタム table_settings.yaml の動作に沿って、次のバージョン 7.1 の更新を適用します。

  • データ プロダクト: コピーされたファイルを明示的なオーバーライドにトリミングします。特に、sales_document_flow の古い materializationType: incremental オーバーライド(動作の変更と孤立したオブジェクトを参照)と変更されていない dataformTags(たとえば、billing_document_headers と billing_document_items が monthly から hourly に変更された場合)をトリミングします。
  • データ基盤: カスタム SAP 基盤ファイルとバージョン 7.1 table_settings.default.yaml の差分を比較して、追加された ECC テーブル(faglflext、glt0)とデフォルトのアサーション(makt、vbak)を保持します。
  • 時間パーティショニング: 非推奨の partitionType: DATE | DATETIME | TIMESTAMP を partitionType: time と dataType: DATE | DATETIME | TIMESTAMP に置き換えます。

SAP 列の変更と完全更新の互換性を破る

バージョン 7.1 では、SAP データ プロダクトの列サフィックスを正確な SAP データ ディクショナリ(DDIC)フィールド名に合わせ、23 個の増分 SAP プロダクト テーブル全体で、コア以外の SAP IS-Fashion(*_fsh_*)アドオン列を削除しています。

SAP 列の名前変更と削除のリファレンス

展開して、23 テーブルの SAP 列の名前変更と削除のマップを表示する

データ プロダクト テーブル SAP バージョン バージョン 7.0.x 列 バージョン 7.1 の列またはステータス
accounts_payable accounts_payable S/4HANA bus_transac_type_bttype
condition_contract_coco_number
inventory_movement_category_invoice_mov_categ
service_document_type_service_document_type
service_document_service_document_id
service_document_item_service_document_item_id
partner_service_document_type_pservice_document_type
partner_service_document_pservice_document_id
partner_service_document_item_pservice_document_item_id
company_code_for_budget_account_bdgt_account_company_code
business_transaction_category_bttype
condition_contract_coco_num
inventory_movement_category_inv_mov_categ
service_document_type_service_doc_type
service_document_service_doc_id
service_document_item_service_doc_item_id
partner_service_document_type_pservice_doc_type
partner_service_document_pservice_doc_id
partner_service_document_item_pservice_doc_item_id
company_code_for_budget_account_bdgt_account_cocode
accounts_receivable accounts_receivable S/4HANA 前の行の accounts_payable と同じ 10 列 前の行の accounts_payable と同じ名前が変更された 10 列
addresses addresses ECC、S/4HANA flag_x400flagcomm8 flag_x400_flagcomm8
bill_of_materials bill_of_materials_items ECC、S/4HANA deviation_values_fsh_vmkz、quantity_distribution_profile_fsh_pgqr、quantity_distribution_profile_reference_fsh_pgqrrf、critical_component_fsh_critical_comp、critical_level_fsh_critical_level 削除済み(IS-Fashion アドオン)
billing_documents billing_document_items ECC、S/4HANA season_year_fsh_season_year、season_fsh_season、collection_fsh_collection、theme_fsh_theme 削除済み(IS-Fashion アドオン)
customers customers ECC、S/4HANA name_of_representative_j_1_kfrepre
type_of_business_j_1_kftbus
type_of_industry_j_1_kftind
name_of_representative_j_1kfrepre
type_of_business_j_1kftbus
type_of_industry_j_1kftind
delivery_documents delivery_document_headers ECC number_category_1_rpfaess
number_category_2_rpkist
number_category_3_rpcont
number_category_4_rpsonst
loading_sequence_number_rpflgnr
number_category_1_bev1_rpfaess
number_category_2_bev1_rpkist
number_category_3_bev1_rpcont
number_category_4_bev1_rpsonst
loading_sequence_number_bev1_rpflgnr
delivery_documents delivery_document_headers S/4HANA header_customer_reserve_status1_suvk01~5_suvk05
item_customer_reserve_status1_suvs01~5_suvs05
header_customer_reserve_status1_uvk01~5_uvk05
item_customer_reserve_status1_uvs01~5_uvs05
delivery_documents delivery_document_items ECC、S/4HANA cfop_code_and_extension_j_1_bcfop
tax_law_icms_j_1_btaxlw1
tax_law_ipi_j_1_btaxlw2
iss_tax_law_j_1_btaxlw3
cofins_tax_law_j_1_btaxlw4
pis_tax_law_j_1_btaxlw5
sd_tax_code_j_1_btxsdc
cfop_code_and_extension_j_1bcfop
tax_law_icms_j_1btaxlw1
tax_law_ipi_j_1btaxlw2
iss_tax_law_j_1btaxlw3
cofins_tax_law_j_1btaxlw4
pis_tax_law_j_1btaxlw5
sd_tax_code_j_1btxsdc
inventory_and_special_stocks sales_order_stock ECC season_year_fsh_season_year、season_fsh_season、collection_fsh_collection、theme_fsh_theme、allocated_stock_quantity_fsh_salloc_qty 削除済み(IS-Fashion アドオン)
inventory_and_special_stocks special_stocks_from_vendor ECC sales_order_stock と同じ 5 つの *_fsh_* 列 削除済み(IS-Fashion アドオン)
inventory_and_special_stocks special_stocks_with_customer ECC sales_order_stock と同じ 5 つの *_fsh_* 列 削除済み(IS-Fashion アドオン)
production_orders production_order_header ECC、S/4HANA master_production_order_fsh_mprod_ord 削除済み(IS-Fashion アドオン)
production_orders production_order_item ECC、S/4HANA season_year_fsh_season_year、season_fsh_season、collection_fsh_collection、theme_fsh_theme、allocated_stock_quantity_fsh_salloc_qty 削除済み(IS-Fashion アドオン)
purchasing_documents purchasing_document_account_assignments S/4HANA service_document_type_service_document_type
service_document_service_document_id
service_document_item_service_document_item_id
service_document_type_service_doc_type
service_document_service_doc_id
service_document_item_service_doc_item_id
purchasing_documents purchasing_document_headers ECC、S/4HANA discount_days1_zbd1_t、discount_days2_zbd2_t、discount_days3_zbd3_t
cash_discount_percentage1_zbd1_p、cash_discount_percentage2_zbd2_p
logical_system_logsy
discount_days1_zbd1t、discount_days2_zbd2t、discount_days3_zbd3t
cash_discount_percentage1_zbd1p、cash_discount_percentage2_zbd2p
logical_system_logsys
purchasing_documents purchasing_document_items ECC、S/4HANA inflation_index_j_1_aindxp
inflation_index_date_j_1_aidatep
inflation_index_j_1aindxp
inflation_index_date_j_1aidatep
purchasing_documents purchasing_document_types ECC 9 個の *_fsh_* 列: vas_active_flag_fsh_vas_act、determination_procedure_fsh_vas_kalsm、vas_deletion_criteria_fsh_vas_del、vas_determination_date_fsh_vas_detdt、excl_return_items_fsh_excl_return、determination_procedure_fsh_var_kalsm、determination_procedure_fsh_dpr_detpro、generic_material_creation_fsh_po_idoc、auto_distribution_fsh_auto_dc 削除済み(IS-Fashion アドオン)
purchasing_documents purchasing_document_types S/4HANA 同じ 9 つの ECC *_fsh_* 列と vas_quantity_correlation_fsh_vas_corr、variants_optional_fsh_vm_act(合計 11) 削除済み(IS-Fashion アドオン)
purchasing_documents purchasing_document_vendor_confirmations ECC、S/4HANA allocated_stock_quantity_fsh_salloc_qty 削除済み(IS-Fashion アドオン)
purchasing_documents purchasing_documents_history ECC、S/4HANA logical_system_logsy(ECC、S/4HANA)
quantity_quantity_diff(S/4HANA)
season_year_fsh_season_year、season_fsh_season、 collection_fsh_collection、theme_fsh_theme(ECC、S/4HANA)
logical_system_logsys(ECC、S/4HANA)
quantity_qty_diff(S/4HANA)
削除済み(IS-Fashion アドオン)
universal_journal universal_journal_entry_line_items S/4HANA business_transaction_type_bttype
custom_business_transaction_type_not_used_yet_cbttype
account_assignment_type_accasty
partner_account_assignment_type_paccasty
business_transaction_category_bttype
business_transaction_type_cbttype
object_type_accasty
partner_object_type_paccasty
vendor_invoices vendor_invoice_headers ECC、S/4HANA logical_system_logsy logical_system_logsys(改行なしの company_code_bukrs も追加)
vendor_invoices vendor_invoice_items ECC、S/4HANA season_year_fsh_season_year、season_fsh_season、 fashion_collection_fsh_collection、fashion_theme_fsh_theme 削除(IS-Fashion アドオン、改行なしの company_code_bukrs も追加)
vendors vendors ECC、S/4HANA name_of_representative_j_1_kfrepre
type_of_business_j_1_kftbus
type_of_industry_j_1_kftind
name_of_representative_j_1kfrepre
type_of_business_j_1kftbus
type_of_industry_j_1kftind

1 回限りのフル更新用の追加テーブル

該当する場合は、次の増分テーブルで 1 回限りのターゲットを絞った完全更新(ターゲットを絞った完全更新を実行する)を実行します。

  • 最初のバージョン 7.1 の増分実行(S/4HANA)の前または実行時に必要: material_documents(cortex.sap.products.materials_movement)は 13 個の MATDOC 在庫列を追加し、uniqueKey を material_document_record_type で拡張します。
  • 小数点以下 2 桁以外の通貨(TCURX スケーリング)を転記する場合に必要: asset_annual_cumulative_balances(S/4HANA)と vendor_open_items、vendor_cleared_items、customer_open_items、customer_cleared_items(ECC)。(accounts_payable、accounts_receivable、purchasing_document_headers は、上記の 23 個のテーブルのリストにすでに含まれています)。
  • sales_performance SAP ERP サンプルを有効にする場合に必要: sales_performance(cortex_samples.sap.products.sales_performance、customers 後に更新)は、新しい signed_net_value_bounds アサーションによって検証された signed_net_value_in_document_currency などの v7.1 列を追加します(販売実績の分析情報をご覧ください)。

これらの増分テーブルで 1 回限りのフル更新を実行して、バージョン 7.0.x の結合と null 値を許容する LEFT JOIN 一意キーの不具合による以前の重複を削除します。

  • 顧客、ベンダー、住所の結合: business_partner_addresses、business_partner_bank_details、ダウンストリームの supplier_spend_analysis(vendors の後に更新)。
  • 強化された uniqueKey(ECC、S/4HANA): vendor_invoice_account_assignments と countries。
  • 保護された null 許容の LEFT JOIN 一意キー(ECC、S/4HANA): asset_transaction_types、cost_elements、cost_centers、profit_centers、currency_codes、set_headers、depreciation_terms、fixed_assets_master、general_ledger_accounts、country_tax_regions、languages、ledger_master、material_cross_plant_batches、material_plant_batches、material_batch_stocks、material_plants、material_movement_types、flattened_product_hierarchies、project_structure、distribution_channels、divisions、sales_organizations、units_of_measurement。
  • 保護された null 許容の LEFT JOIN 一意キー(ECC のみ): special_stocks_with_vendor。
  • null 値を許容する LEFT JOIN 一意キーの保護(S/4HANA のみ): financial_hierarchy_nodes と group_journal_entries(クラスタリングも追加)。

動作の変更と孤立したオブジェクト

  • sales_document_flow のマテリアライズ: ECC と S/4HANA でデフォルトの materializationType が incremental から table に変更され、未請求の出荷が引き続き表示されるようになりました(行数が増加)。コンパイルする前に、古い materializationType: incremental オーバーライドを削除します。これは、uniqueKeys のない incremental モデルではコンパイルが失敗するためです。--full-refresh は必須です。
  • 孤立した S/4HANA テーブル: materials_by_storage_location が cortex.sap.products.materials から ECC 専用の cortex.sap.products.inventory_and_special_stocks に移動されました。S/4HANA で、下流のコンシューマがクエリを実行していないことを確認した後、以前の PRODUCT_DATASET.materials_by_storage_location テーブル(および、他の有効な S/4HANA プロダクトが参照していない場合は、未使用の mard、mbew、mbewh、t001l 基盤テーブル)を削除します。
  • 既存のデータに対するアサーション: 1 回限りの完全更新が完了するまで、アップグレード前の重複行でデフォルトのアサーションが失敗することがあります。重大度タグは severity_LEVEL を出力し、ブロック動作はルールごとに設定されます(blocking: true)。

カスタム データ プロダクトと Python ビルダーを移行する

カスタム モジュールまたは Python ビルダーを管理している場合は、ビルドする前に次の更新を適用します(詳細については、拡張性ガイドをご覧ください)。

カスタム YAML と JavaScript のデータ プロダクト

  • publisher.publish() / publisher.operate() を使用する: publish(...) と operate(...) の呼び出しを const publisher = require("includes/publisher.js"); に置き換えて、ブロッキング アサーションと行 / 列レベルのセキュリティ フックが実行されるようにします。
  • incremental.getFilter() 呼び出しを更新する: 3 番目の引数として、オプション オブジェクト({ targetColumn: "..." } または { timestampColumn: "..." })または既知のソースタイプの省略形("sap"、"sfdc"、"salesforce")を渡します。他の文字列はエラーをスローするようになりました。
  • アサーションを明示的に宣言する: バージョン 7.0.x の暗黙的なキーアサーションを table_settings.default.yaml の assertions.standardRules に置き換えます(データ品質アサーションをご覧ください)。
  • 非推奨のキーとビルダー エイリアスをクリーンアップ: manifest.yaml から type: を、config/config.yaml から moduleType: を削除しました。非推奨のエイリアスを置き換えます(generic_product、composite_product、generic_composite_product、sap_bdc_product → flat_product、sfdc → sfdc_foundation)。flat_product のデフォルトは incremental です(以前の generic_product / composite_product のデフォルトは table でした)。そのため、materializationType を明示的に設定するか、uniqueKeys を指定してください。

カスタム Python ビルダー

  • common.sdk からインポートする: common.builders.*、common.schemas.*、削除された common.registry のインポートを common.sdk に置き換えます。
  • 具体的なサブクラスを使用する: FlatProductBuilder または FoundationBuilder を直接サブクラス化し(ProductBuilder[DataProductModuleConfig] ではなく)、build() で (self, node, ctx) を受け入れます。
  • プログラム ビルダーに table_settings_schema = None を設定する: FlatProductBuilder をサブクラス化するビルダーは、デフォルトで table_settings ファイルを想定しています。 ビルダーが ファイルなしで SQL を生成する場合は、table_settings_schema = None を設定します。
  • ビルダーを再配置する: 非推奨のブループリント ローカル ./builder.py モジュールを NAMESPACE/builders/ に移動し、manifest.yaml で参照される plugin_id を使用して、名前空間ツリー内の __init__.py ファイルを削除します。

次のステップ