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

walkthrough: Walkthrough charts fails due to NameError: name 'matching_blocks' is not defined #757

Closed
pabloarosado opened this issue Jan 9, 2023 · 2 comments
Assignees

Comments

@pabloarosado
Copy link
Contributor

One-liner

Walkthrough charts fails due to NameError: name 'matching_blocks' is not defined

Environment

  • Python 3.9.4
  • MacOS 11.6.2
  • Working on live

Context & details

When trying to replace the variables of dataset Learning costs, J. Doyne Farmer and François Lafond (2016) with Cost of different technologies (Farmer & Lafond (2016), 2023), I get the error:

An internal error occurred in the application
×
Traceback (most recent call last):
  File "/Users/prosado/Documents/owid/repos/etl/.venv/lib/python3.9/site-packages/pywebio/session/threadbased.py", line 86, in main_task
    target()
  File "/Users/prosado/Documents/owid/repos/etl/walkthrough/cli.py", line 53, in <lambda>
    lambda: phase_func(run_checks=run_checks, dummy_data=dummy_data),
  File "/Users/prosado/Documents/owid/repos/etl/walkthrough/charts.py", line 64, in app
    nav.get_suggestions_and_mapping()
  File "/Users/prosado/Documents/owid/repos/etl/walkthrough/charts.py", line 367, in get_suggestions_and_mapping
    self.suggestions = find_mapping_suggestions(missing_old, missing_new, similarity_name)
  File "/Users/prosado/Documents/owid/repos/etl/etl/match_variables.py", line 323, in find_mapping_suggestions
    missing_new["similarity"] = [matching_function(old_name, new_name) for new_name in missing_new["name_new"]]
  File "/Users/prosado/Documents/owid/repos/etl/etl/match_variables.py", line 323, in <listcomp>
    missing_new["similarity"] = [matching_function(old_name, new_name) for new_name in missing_new["name_new"]]
  File "/Users/prosado/Documents/owid/repos/etl/.venv/lib/python3.9/site-packages/fuzzywuzzy/utils.py", line 38, in decorator
    return func(*args, **kwargs)
  File "/Users/prosado/Documents/owid/repos/etl/.venv/lib/python3.9/site-packages/fuzzywuzzy/utils.py", line 29, in decorator
    return func(*args, **kwargs)
  File "/Users/prosado/Documents/owid/repos/etl/.venv/lib/python3.9/site-packages/fuzzywuzzy/utils.py", line 47, in decorator
    return func(*args, **kwargs)
  File "/Users/prosado/Documents/owid/repos/etl/.venv/lib/python3.9/site-packages/fuzzywuzzy/fuzz.py", line 47, in partial_ratio
    blocks = m.get_matching_blocks()
  File "/Users/prosado/Documents/owid/repos/etl/.venv/lib/python3.9/site-packages/fuzzywuzzy/StringMatcher.py", line 58, in get_matching_blocks
    self._matching_blocks = matching_blocks(self.get_opcodes(),
NameError: name 'matching_blocks' is not defined

@lucasrodes
Copy link
Member

lucasrodes commented Jan 9, 2023

This should have been fixed by #747. Are you using the up-to-date environment? If not, run poetry install and run walkthrough again.

Let me know if this solves your issue!

@pabloarosado
Copy link
Contributor Author

Indeed, problem solved, thanks!

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

No branches or pull requests

3 participants