Skip to content

Glue code for fgdb metadata - #2312

Open
jackrosacker wants to merge 20 commits into
mainfrom
jcr-fgdb-metadata-lifecycle
Open

Glue code for fgdb metadata#2312
jackrosacker wants to merge 20 commits into
mainfrom
jcr-fgdb-metadata-lifecycle

Conversation

@jackrosacker

@jackrosacker jackrosacker commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Adds a unified dcpy lifecycle package esri write_metadata CLI command that writes Esri-format metadata XML into both shapefiles and geodatabases from product-metadata YAML. Previously there was no GDB write path; the shapefile path was a standalone command in shapefiles.py that is now removed.

Key changes

  • write_metadata CLI: single command for both file types. GDB layer is inferred automatically for single-layer GDBs via fgdb.resolve_layer; required explicitly for multi-layer GDBs and shapefiles.
  • Per-layer column overrides: File.layers / GdbLayerOverrides added to the metadata model so GDB entries in metadata.yml can declare per-layer column overrides, merged at write time via calculate_layer_dataset_metadata.
  • Esri type overrides: format-specific types (String, SmallInteger, etc.) go in column.custom["fgdb_data_type"] / custom["shp_data_type"] rather than data_type.
  • Cleanup: old shapefile write command removed; low-level metadata helpers moved to esri_metadata.py; tests reorganized to match.

Also of note

There are a bunch of complementary changes to the pluto YAML in the product-metadata repo. Since that repo has been archived, I plan to get this repo merged, and then will transfer the p-m edits directly in a new PR. Until then, the YAML changes can be seen in the test cases.

resolves #2303

fyi @alexrichey - I may need your help with all of the merge conflicts associated with this PR!

@codecov

codecov Bot commented Apr 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.70%. Comparing base (ad1d69b) to head (2043754).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dcpy/lifecycle/package/shapefiles.py 50.00% 3 Missing and 2 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
dcpy/lifecycle/package/shapefiles.py 87.17% <50.00%> (-5.98%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jackrosacker
jackrosacker force-pushed the jcr-fgdb-metadata-lifecycle branch from 475819c to 3ee7766 Compare April 10, 2026 19:28
@jackrosacker
jackrosacker requested a review from alexrichey July 20, 2026 14:57
@jackrosacker
jackrosacker marked this pull request as ready for review July 20, 2026 14:58

@alexrichey alexrichey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write glue code to connect product-metadata to fgdb metadata utils

2 participants