Skip to content

Conversation

SprinTech
Copy link
Collaborator

@SprinTech SprinTech commented Feb 3, 2025

CLI arguments have been added to request data by specific years :

  • --refresh-type : type of refresh to perform. This could be a full refresh ("all"), a collection of last year data ("last") or a collection of specific years ("custom").
  • --custom-years : in case where --refresh-type custom have been specified, the user can indicate the years of data he wanted to collect. Years have to be comma separated. Example of a CLI command : uv run pipelines/run.py run build_database --refresh-type custom --custom-years 2018,2024

@moreaupascal56
Copy link
Collaborator

moreaupascal56 commented Feb 5, 2025

Hello, j'ai testé en prenant les changements d'ici et les changements plus récents sur #9, ça fonctionne nickel pour moi.
En fait le seul soucis que je vois c'est au niveau de l'help de la CLI:

pascal@pascal-pc:~/path-to/13_pollution_eau$ uv run pipelines/run.py run  --help
Usage: run.py run [OPTIONS] TASK_NAME

  Run a specified task.

Options:
  --refresh-type [all|last|custom]
                                  Type of refresh to perform
  --custom-years TEXT             Comma-separated list of years to process
                                  (for custom refresh type)
  --help                          Show this message and exit.

ou l'on ne voit pas que ces arguments sont uniquement pour la task build_database mais pour la commande run, en soi ce n'est pas très grave mais voila. Peut être juste le spécifier dans la description des arguments de la CLI.

Et peut être ducoup changer la description quand on fait list pour rajouter les arguments afin que ce soit plus clair:

Aujourd'hui on a :

pascal@pascal-pc:~/path-to/13_pollution_eau$ uv run pipelines/run.py list 
Available tasks:
- build_database: Consolidate data into the database.

On pourrait avoir:

pascal@pascal-pc:~/path-to/13_pollution_eau$ uv run pipelines/run.py list 
Available tasks:
- build_database: Consolidate data into the database.
     Args: refresh-type and custom-years (ou quelque chose comme ça)

Ce n'est qu'une suggestion :)

@SprinTech
Copy link
Collaborator Author

@moreaupascal56 Tu as raison Pascal, c'est plus intéressant de garder uniquement les informations pertinentes sur la CLI. Je viens de faire une update pour prendre en compte tes suggestions. Je te laisse regarder et me dire si ça correspond à ce que tu imaginais :)

@SprinTech SprinTech force-pushed the feature/request-by-specific-year branch 3 times, most recently from 4195ac8 to 2f98fd6 Compare February 5, 2025 14:35
@SprinTech SprinTech force-pushed the feature/request-by-specific-year branch from 2f98fd6 to 47c1d84 Compare February 5, 2025 14:36
Copy link
Contributor

@NicolasDuchenne NicolasDuchenne left a comment

Choose a reason for hiding this comment

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

Est ce qu'il serait possible d'update le readme avec des exemples d'utilisation du build database avec des paramètres

@SprinTech
Copy link
Collaborator Author

Update réalisée pour prendre en compte tes retours @NicolasDuchenne

@SprinTech SprinTech force-pushed the feature/request-by-specific-year branch 3 times, most recently from 394155c to a31872b Compare February 7, 2025 16:24
NicolasDuchenne
NicolasDuchenne previously approved these changes Feb 7, 2025
@NicolasDuchenne NicolasDuchenne merged commit e8198c8 into dataforgoodfr:main Feb 7, 2025
1 check passed
@SprinTech SprinTech deleted the feature/request-by-specific-year branch February 12, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants