Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[infra] change download functions to consume CKAN endpoint #1063

Closed
wants to merge 23 commits into from

Conversation

lucascr91
Copy link
Collaborator

@lucascr91 lucascr91 commented Jan 15, 2022

#1129

  • search
  • list_datasets
  • list_dataset_tables
  • get_dataset_description
  • get_table_description
  • get_table_columns
  • Test para _safe_fetch

Segue uma breve descrição das alterações feitas em cada uma das funções. Procurei manter funcionalidades e parâmetros da função original, quando possível.

search:

Ver: #1016

list_datasets e list_dataset_tables

Assim como as funções originais, as novas funções têm os parâmetros with_description e verbose, como os mesmos defaults. O retorno das funções também guarda semelhança com o retorno das funções originais. Por default, as funções retornam um output padronizada pela função _print_output. Alternativamente, as funções podem retornar o resultado em uma lista, usando verbose=False.

get_dataset_description, get_table_description, get_table_columns

Mantive as funcionalidades originais e poucas alterações foram feitas nos testes.

Tests

Para facilitar os testes das funções alteradas nesse PR, escrevi um bash:

functionsToTest=(test_list_datasets_simple_verbose test_list_datasets_simple_list test_list_datasets_complete_list test_list_datasets_complete_verbose test_list_dataset_tables_simple_verbose test_list_dataset_tables_simple_list test_list_dataset_tables_complete_list test_list_dataset_tables_complete_verbose test_get_dataset_description test_get_dataset_description_verbose_false test_get_table_description test_get_table_description_verbose_false test_get_table_columns test_get_table_columns_verbose_false test_search)

for function in "${functionsToTest[@]}"
do 
    pytest test_metadata.py -k $function -v
done

@lucascr91 lucascr91 changed the title Pr 1016 [infra] modify list_datasets function to consume CKAN endpoint Jan 15, 2022
@lucascr91 lucascr91 changed the title [infra] modify list_datasets function to consume CKAN endpoint [infra] modify download functions to consume CKAN endpoint Jan 15, 2022
@lucascr91 lucascr91 changed the title [infra] modify download functions to consume CKAN endpoint [infra] modify list_datasets function to consume CKAN endpoint Jan 15, 2022
@lucascr91 lucascr91 changed the title [infra] modify list_datasets function to consume CKAN endpoint [infra] modify download functions to consume CKAN endpoint Jan 15, 2022
@lucascr91 lucascr91 changed the title [infra] modify download functions to consume CKAN endpoint [infra] change download functions to consume CKAN endpoint Jan 15, 2022
@JoaoCarabetta JoaoCarabetta changed the base branch from master to python-v1.6.2 January 24, 2022 22:22
@d116626 d116626 deleted the branch basedosdados:python-1.6.2 February 12, 2022 19:05
@d116626 d116626 closed this Feb 12, 2022
@JoaoCarabetta JoaoCarabetta reopened this Feb 14, 2022
@d116626 d116626 changed the base branch from python-v1.6.2 to python-1.6.2 February 14, 2022 22:16
@JoaoCarabetta JoaoCarabetta mentioned this pull request Feb 14, 2022
3 tasks
@lucascr91 lucascr91 closed this Feb 22, 2022
@lucascr91
Copy link
Collaborator Author

Esse PR foi transferido para #1129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants