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

Update get cmd for 'all' when retrieving all data-types. #541

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

axif0
Copy link
Collaborator

@axif0 axif0 commented Jan 5, 2025

Contributor checklist


Description

Added get cmd for 'all' when retrieving all data-types.

Related issue

Copy link

github-actions bot commented Jan 5, 2025

Thank you for the pull request!

The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Data rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you!

Maintainer checklist

  • The linting and formatting workflow within the PR checks do not indicate new errors in the files changed

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@@ -342,7 +342,7 @@ def query_data(
print(
f"Successfully queried and formatted data for {lang.title()} {target_type}."
)
return {"success": True, "skipped": False}
# return {"success": True, "skipped": False}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because we are using return inside that loop, the function will exit on the first iteration that reaches any return statement. As a result, tqdm never finishes iterating through its items.
Also in tqdm never ends as 100%. like this-
image

Copy link
Collaborator Author

@axif0 axif0 Jan 5, 2025

Choose a reason for hiding this comment

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

Had to check #537 for iterating through all the language.

@@ -208,35 +208,35 @@ def prompt_user_download_all():
f"Updating data for language(s): {language.title()}; data type(s): {data_type.capitalize()}"
)
existing_files = list(Path(output_dir).glob(f"{language}/{data_type}.json"))
if existing_files:
if existing_files and not overwrite:
Copy link
Collaborator Author

@axif0 axif0 Jan 5, 2025

Choose a reason for hiding this comment

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

If user gives -o for overwrite enable, it still asks user input. Like this in first cmd-

image

The second cmd is the outputted result after fixing.

@axif0 axif0 requested a review from andrewtavis January 5, 2025 19:44
language_qid = language
if (
language is not None
and (language.startswith("Q") or language.startswith("q"))
Copy link
Member

Choose a reason for hiding this comment

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

Added this in as lower casing the language was actually breaking the ability to pass a QID as a language :)

@@ -547,6 +544,9 @@ def format_sublanguage_name(lang, language_metadata=_languages):
> format_sublanguage_name("english", language_metadata)
'English'
"""
if (lang.startswith("Q") or lang.startswith("q")) and lang[1:].isdigit():
Copy link
Member

Choose a reason for hiding this comment

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

The next part of fixing passing QIDs for languages. There may need to be more fixes related to this, @axif0! Goal was getting total to work :)

Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

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

Thanks for this, @axif0! Let me know if you're free for the hour before the sync this Saturday :) Would be great if we could meet and try out all of the functionality and document what's working or needs a bit of polishing 😊

Amazing progress so far! Really thanks so much :)

@andrewtavis andrewtavis merged commit 8073210 into scribe-org:main Jan 7, 2025
5 checks passed
@axif0
Copy link
Collaborator Author

axif0 commented Jan 8, 2025

Looking forward to our meeting an hour before the sync this Saturday.

@andrewtavis
Copy link
Member

Me too, @axif0! 😊

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.

2 participants