Skip to content

Fix: historical_database = False e adicionar explicitamente coverage_…#1550

Open
luizavboas wants to merge 11 commits into
mainfrom
fix/br_inmet_bdmep_update_django_metadata
Open

Fix: historical_database = False e adicionar explicitamente coverage_…#1550
luizavboas wants to merge 11 commits into
mainfrom
fix/br_inmet_bdmep_update_django_metadata

Conversation

@luizavboas
Copy link
Copy Markdown
Collaborator

@luizavboas luizavboas commented May 20, 2026

PR para ajuste do update de metadados do flow de estações. A ausência de um coverage_type explícito estava gerando erro porque o valor default é "part_bdpro", incompatível com uma tabela que não tem coluna de data e tem o parâmetro historical_database=False

Summary by CodeRabbit

  • Configuration Updates
    • Updated dataset coverage settings to provide all available data
    • Modified historical database processing configuration

Review Change Stack

@luizavboas luizavboas self-assigned this May 20, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

📝 Walkthrough

Walkthrough

The INMET BDMEP estacao flow's metadata configuration is updated to declare all station data as freely available and disable the historical database flag, simplifying the data classification and processing behavior for this dataset.

Changes

Metadata Configuration Update

Layer / File(s) Summary
Estacao metadata configuration update
pipelines/datasets/br_inmet_bdmep/flows.py
The update_django_metadata call in the br_inmet_bdmep__estacao flow is updated to set coverage_type to "all_free" and hard-code historical_database to False instead of passing it as a dynamic parameter.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • basedosdados/pipelines#1535: Also modifies the historical_database argument in the same update_django_metadata() call in br_inmet_bdmep__estacao, with directly related changes to metadata configuration logic.
  • basedosdados/pipelines#1515: Reworks the same flows.py metadata update step for the estacao and microdados flows, providing context for the metadata configuration pattern being used.

Suggested labels

check-metadata

Suggested reviewers

  • folhesgabriel
  • Winzen

Poem

🐰 A station's data, now freely shared,
All coverage true, the flag declared—
No history weighs this simple flow,
Just clean metadata's gentle glow! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title starts with 'Fix:' instead of following the repository's required format with bracketed keywords like [Bugfix], [Feature], etc. Update the title to follow the template format: start with a bracketed keyword such as [Bugfix] (e.g., '[Bugfix] br_inmet_bdmep: add explicit coverage_type to update_django_metadata').
Description check ⚠️ Warning The description lacks the required structure from the template, missing sections like Motivation/Context, Technical Details, Testing/Validation, Risks/Mitigations, and Dependencies. Restructure the description using the template: add sections for Motivation/Context, Technical Details (main changes, data/schema changes, performance impact), Testing/Validation checkboxes, Risks/Mitigations, and Dependencies.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/br_inmet_bdmep_update_django_metadata

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@luizavboas luizavboas added the bug Defeito em código, tooling, CI ou comportamento de pipeline label May 20, 2026
@luizavboas luizavboas marked this pull request as ready for review May 20, 2026 13:48
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pipelines/datasets/br_inmet_bdmep/flows.py (1)

129-131: ⚡ Quick win

Remove the unused historical_database parameter.

The historical_database parameter is defined but never used, since line 173 now hardcodes False. This creates dead code that may confuse future maintainers.

Since the estacao table fundamentally lacks a date column (as stated in the PR description), hardcoding False at line 173 is appropriate. The parameter definition should be removed for clarity.

🧹 Proposed fix to remove unused parameter
     dbt_alias = Parameter("dbt_alias", default=True, required=False)
-    historical_database = Parameter(
-        "historical_database", default=False, required=False
-    )
     rename_flow_run = rename_current_flow_run_dataset_table(
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipelines/datasets/br_inmet_bdmep/flows.py` around lines 129 - 131, Remove
the unused Parameter named historical_database (the
Parameter("historical_database", default=False, required=False)) from the flows
module and delete any references to it so the flow no longer defines dead
config; keep the hardcoded False behavior where estacao processing requires it,
and ensure you also remove any related imports or documentation strings that
only referenced historical_database (e.g., any mention in flow registration or
parameter lists) so there is no lingering dead code.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pipelines/datasets/br_inmet_bdmep/flows.py`:
- Around line 129-131: Remove the unused Parameter named historical_database
(the Parameter("historical_database", default=False, required=False)) from the
flows module and delete any references to it so the flow no longer defines dead
config; keep the hardcoded False behavior where estacao processing requires it,
and ensure you also remove any related imports or documentation strings that
only referenced historical_database (e.g., any mention in flow registration or
parameter lists) so there is no lingering dead code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cb5c1ab3-7df5-4c71-adb8-0824f086f056

📥 Commits

Reviewing files that changed from the base of the PR and between f9e7ebd and 837e93a.

📒 Files selected for processing (1)
  • pipelines/datasets/br_inmet_bdmep/flows.py

@luizavboas luizavboas requested a review from folhesgabriel May 20, 2026 18:02
@luizavboas luizavboas requested a review from erickscaraujo May 26, 2026 17:17
@luizavboas luizavboas removed the request for review from erickscaraujo May 26, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Defeito em código, tooling, CI ou comportamento de pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants