trufnetwork / trufnetwork/adapters

Bug: Argentina preprocess doesn´t skip based on variable

Open
#205 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
0
Forks
3
Avg merge
2h 9m
Merged PRs (30d)
1

Description

Problem

preprocess_flow.py processes ALL available dates instead of respecting LAST_PREPROCESS_SUCCESS_DATE like other Argentina flows do.

Current behavior (line 188-194):

for date in self.raw_provider.list_available_keys():
    if self.processed_provider.exists(date):
        continue
    await self.process_date(date)

Expected behavior: Filter dates by LAST_PREPROCESS_SUCCESS_DATE first, then check if already processed.

Solution

Add date filtering before the loop:

last_preprocess_date = await variables.Variable.aget(
    ArgentinaFlowVariableNames.LAST_PREPROCESS_SUCCESS_DATE,
    default=ArgentinaFlowVariableNames.DEFAULT_DATE
)
dates_to_process = [d for d in self.raw_provider.list_available_keys() if d > last_preprocess_date]

This matches the pattern already used in aggregate_products_flow.py and insert_products_flow.py.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open preprocess_flow.py and inspect the loop around lines 188-194. Compare the date-selection pattern in aggregate_products_flow.py and insert_products_flow.py, then verify that dates after LAST_PREPROCESS_SUCCESS_DATE are considered while already processed dates remain skipped.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.