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

Remove Oxford Dictionaries API Functionality #210

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

WayneLambert
Copy link
Owner

Addresses the following:

  • Removes Oxford API functionality from the app since Oxford Dictionaries essentially eliminated their hobby tier and made it so their lowest tier involves a £600 per annum "setup fee".
  • Removes any test functionality relating to the usage of the API
  • Removes any templating relating to word definitions, etc

@WayneLambert WayneLambert added dependencies Pull requests that update a dependency file app: countdown_letters Issues relating to the `countdown_letters` app labels Mar 5, 2024
@WayneLambert WayneLambert self-assigned this Mar 5, 2024
@WayneLambert WayneLambert merged commit 6fb5667 into develop Mar 5, 2024
1 check failed
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey WayneLambert - Here's my review!

General suggestions:

  • Ensure that all new or modified logic paths introduced by these changes are covered by existing or new tests.
  • Verify that the removal of the Oxford API and its related components does not leave any functionality untested, especially the new logic replacing the Oxford API functionality.
  • Confirm that any front-end components relying on data from the Oxford API are updated or removed to prevent runtime errors.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -72,7 +71,6 @@ def test_get_shortlisted_words():
assert len(shortlisted_words) >= 1, "Should have at least one element"


@pytest.mark.vcr()
Copy link

Choose a reason for hiding this comment

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

question (llm): I noticed that tests related to the Oxford Dictionaries API functionality have been removed, which aligns with the pull request's goal. However, it's important to ensure that the removal of these tests doesn't leave any functionality untested, especially the new logic replacing the Oxford API functionality. Could you confirm if all new or modified logic paths introduced by these changes are covered by existing or new tests?

@@ -72,7 +71,6 @@
assert len(shortlisted_words) >= 1, "Should have at least one element"


@pytest.mark.vcr()
def test_get_longest_possible_word(shortlisted_words: list):
Copy link

Choose a reason for hiding this comment

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

praise (llm): Praise for updating the test to reflect the removal of the Oxford API dependency. This ensures that the test suite remains relevant and focused on the current functionality.

@@ -40,23 +40,20 @@ def results_screen(request):
letters_chosen: str = request.GET["letters_chosen"]
players_word: str = request.GET["players_word"]

valid_word = validations.is_in_oxford_api(players_word)
Copy link

Choose a reason for hiding this comment

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

suggestion (llm): Removing the Oxford API call from the view is in line with the PR's objectives. However, it's crucial to ensure that the application's functionality remains consistent and that any new logic introduced to replace the API's functionality is adequately tested, particularly in edge cases where the previous implementation might have behaved differently.

@@ -67,8 +64,7 @@
"comp_word": comp_word,
"comp_word_len": len(comp_word) if comp_word else 0,
"comp_score": logic.get_game_score(len(comp_word)) if comp_word else 0,
"winning_word": comp_word if len(comp_word) > player_word_len else players_word,
"definition_data": definition_data,
Copy link

Choose a reason for hiding this comment

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

suggestion (llm): The removal of definition data from the context is consistent with the removal of the Oxford API. It's good to see the cleanup in the views to reflect the removal of unused data. Ensure that any front-end components relying on this data are also updated accordingly to prevent runtime errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: countdown_letters Issues relating to the `countdown_letters` app dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant