Skip to content

Commit

Permalink
Use main instead of tag in publishing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bendnorman committed Dec 12, 2024
1 parent cdbb5a6 commit 5a3e18a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dbcp/commands/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def load_parquet_files_to_bigquery(

# Get the BigQuery dataset
# the "production" bigquery datasets do not have a suffix
destination_suffix = "" if build_ref.startswith("v20") else f"_{build_ref}"
destination_suffix = "" if build_ref == "main" else f"_{build_ref}"
dataset_id = f"{destination_blob_prefix}{destination_suffix}"
dataset_ref = client.dataset(dataset_id)

Expand Down Expand Up @@ -136,12 +136,12 @@ class OutputMetadata(BaseModel):

@validator("git_ref")
def git_ref_must_be_dev_or_tag(cls, git_ref: str | None) -> str | None:
"""Validate that the git ref is either "dev" or a tag starting with "v20"."""
"""Validate that the git ref is either "dev" or "main"."""
if git_ref:
if (git_ref in ("dev", "sandbox")) or git_ref.startswith("v20"):
if git_ref in ("dev", "sandbox", "main"):
return git_ref
raise ValueError(
f'{git_ref} is not a valid Git rev. Must be "dev" or start with "v20"'
f'{git_ref} is not a valid Git rev. Must be "dev" or "main".'
)
return git_ref

Expand Down

0 comments on commit 5a3e18a

Please sign in to comment.