Skip to content

add latest berries and alter schema to allow empty properties from th…#1572

Merged
Naramsim merged 7 commits into
PokeAPI:masterfrom
programgames:add-latest-berries
Jul 24, 2026
Merged

add latest berries and alter schema to allow empty properties from th…#1572
Naramsim merged 7 commits into
PokeAPI:masterfrom
programgames:add-latest-berries

Conversation

@programgames

@programgames programgames commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

#1126
I added both hopo berry and roseli item.

Also Kee,Marangua,Hopo and Roseli berries in the berry table.
As you said in the issue, new berries don't have much properties as old ones do I had to change the schema to allow empty values.

Datas came from Serebii and bulbapedia :

and then :

I would like to know if it a good practice to add new data add the end of the file like I did.

Thank you

@Naramsim Naramsim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's ok to put everything at the end of the file

Comment thread data/v2/build.py Outdated
Comment thread data/v2/build.py Outdated
Comment thread data/v2/build.py Outdated
Comment thread data/v2/build.py Outdated
@programgames

Copy link
Copy Markdown
Contributor Author

Corrections done

@jemarq04 jemarq04 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a couple comments. Also, could you run make format to fix the python script formatting you're adding?

Comment thread data/v2/build.py Outdated
Comment on lines +1007 to +1014
berry_firmness_id=int(info[2]),
natural_gift_power=int(info[3]),
natural_gift_type_id=int(info[4]),
size=int(info[5]),
max_harvest=int(info[6]),
growth_time=int(info[7]),
soil_dryness=int(info[8]),
smoothness=int(info[9]),
name=item.name[: -len("-berry")] if item.name.endswith("-berry") else item.name,
berry_firmness_id=int(info[2]) if info[2] and info[2].strip() else None,
natural_gift_power=int(info[3]) if info[3] and info[3].strip() else None,
natural_gift_type_id=int(info[4]) if info[4] and info[4].strip() else None,
size=int(info[5]) if info[5] and info[5].strip() else None,
max_harvest=int(info[6]) if info[6] and info[6].strip() else None,
growth_time=int(info[7]) if info[7] and info[7].strip() else None,
soil_dryness=int(info[8]) if info[8] and info[8].strip() else None,
smoothness=int(info[9]) if info[9] and info[9].strip() else None,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we need to check the stripped value. We don't really make that check anywhere else, and I don't believe we've had any issues of unexpected whitespace.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread data/v2/build.py Outdated
growth_time=int(info[7]),
soil_dryness=int(info[8]),
smoothness=int(info[9]),
name=item.name[: -len("-berry")] if item.name.endswith("-berry") else item.name,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
name=item.name[: -len("-berry")] if item.name.endswith("-berry") else item.name,
name=item.name[:-6] if item.name.endswith("-berry") else item.name,

No need to determine the length of a constant string, we can write that in. I'm also thinking using

name=item.name.split("-berry")[0]

would do the same thing and make it clear that you're trying to remove that suffix if it exists, though both could work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@Naramsim

Copy link
Copy Markdown
Member

Hi, @programgames could you fix the conflicts by shifting the ids of the two newly added items and the relative pointers?

@programgames

Copy link
Copy Markdown
Contributor Author

Hi, @programgames could you fix the conflicts by shifting the ids of the two newly added items and the relative pointers?

done

@jemarq04

Copy link
Copy Markdown
Member

There's now a migration with the same index - can you re-create your migration file?

@programgames

programgames commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

There's now a migration with the same index - can you re-create your migration file?

Oh yes :) I should really check the CI next time

@Naramsim
Naramsim merged commit 6c591f1 into PokeAPI:master Jul 24, 2026
19 checks passed
@Naramsim

Copy link
Copy Markdown
Member

Hi! This was lost down the list of PRs. Thanks for fixing the conflicts and the migration!

@pokeapi-machine-user

Copy link
Copy Markdown

A PokeAPI/api-data refresh has started. In ~45 minutes the staging branch of PokeAPI/api-data will be pushed with the new generated data.

The staging branch will be deployed in our staging environment and the entire API will be ready to review.

A Pull Request (master<-staging) will be also created at PokeAPI/api-data and assigned to the PokeAPI Core team to be reviewed. If approved and merged new data will soon be available worldwide at pokeapi.co.

@pokeapi-machine-user

Copy link
Copy Markdown

The updater script has finished its job and has now opened a Pull Request towards PokeAPI/api-data with the updated data.

The Pull Request can be seen deployed in our staging environment when CircleCI deploy will be finished (check the start time of the last build).

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.

5 participants