Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix nested columns constant #102

Merged
merged 4 commits into from
Feb 19, 2024
Merged

Conversation

FelipeSBarros
Copy link
Owner

@cuducos , during the construction of the flatten function I have wrongly added some "column name" (dict keys, for now) in the NESTED_COLUMNS constant.

I did it by reading the API documentation. But once finished the PR #100 I did some test with real data an realized that some "columns" are not nested. I created a issue #101 about it. (sorry, I should have tested before closing the PR... I will try to be more careful next time)

Today I fixed it removing those "columns names" and added some other. This time I have tested with occurrences from the second semester of 2022.

from crossfire import AsyncClient, flatten

client = AsyncClient()
states_dict, _ = await client.states(format="dict")
states_df, _ = await client.states(format="df")

cities_rj, _ = await client.cities(state_id=states_df.id.iloc[0], format="df")

occs = await client.occurrences(
    id_state=cities_rj.state.iloc[16].get("id"),
    id_cities=cities_rj.id.iloc[16],
    initial_date="2022-06-01",
    final_date="2023-01-01",
    # format="df",
)

flatten(occs)

Everythning seems to be right.

@FelipeSBarros FelipeSBarros merged commit 771a750 into master Feb 19, 2024
8 checks passed
@FelipeSBarros FelipeSBarros deleted the fix_nested_columns_constant branch February 19, 2024 00:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants