Skip to content

Commit

Permalink
Get template_db working
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Richey authored and Alex Richey committed Dec 2, 2024
1 parent dc7482a commit 1321358
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/template_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v4
with:
repository: NYCPlanning/product-metadata
path: product_metadata

- name: set_product_metadata_path
run: echo "PRODUCT_METADATA_REPO_PATH=$(pwd)/product_metadata" >> $GITHUB_ENV
working-directory: ./

- name: Load Secrets
uses: 1password/load-secrets-action@v1
with:
Expand Down
7 changes: 6 additions & 1 deletion products/template/build_scripts/export.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from pathlib import Path
import shutil

from dcpy.configuration import PRODUCT_METADATA_REPO_PATH
from dcpy.lifecycle.package import generate_metadata_assets
from dcpy.lifecycle.package import oti_xlsx
from dcpy.connectors.edm import product_metadata, publishing
from dcpy.utils.logging import logger
from dcpy.models.product.dataset import metadata_v2 as md
from dcpy.models.product.metadata import OrgMetadata

from . import PRODUCT_PATH, OUTPUT_DIR, PG_CLIENT, BUILD_KEY

Expand All @@ -21,6 +24,7 @@
"shapefile_polygons",
],
}
org_metadata = OrgMetadata.from_path(Path(PRODUCT_METADATA_REPO_PATH))


def generate_metadata():
Expand All @@ -38,7 +42,8 @@ def generate_metadata():
generate_metadata_assets.DEFAULT_DATA_DICTIONARY_STYLESHEET_PATH,
)
oti_xlsx.write_oti_xlsx(
dataset=md.Metadata.from_path(dataset_metadata_yml).dataset,
org_md=org_metadata,
product="template_db",
output_path=PRODUCT_PATH / "data_dictionary.xlsx",
)

Expand Down

0 comments on commit 1321358

Please sign in to comment.