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

Creating dewiki_core #11

Open
Fetzii opened this issue Jan 27, 2022 · 1 comment
Open

Creating dewiki_core #11

Fetzii opened this issue Jan 27, 2022 · 1 comment

Comments

@Fetzii
Copy link

Fetzii commented Jan 27, 2022

  • spikex version: 0.5.2
  • Python version: 3.9.7
  • Operating System: Windows 10

Description

I tryed to create a german wikigraph and got a type error for the compression_wrapper()

What I Did

spikex create-wikigraph de_wiki_graph --wiki de --dumps-path de_wiki_dumps

Traceback (most recent call last):
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\Scripts\spikex.exe\__main__.py", line 7, in <module>
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\spikex\__main__.py", line 23, in main
    typer.run(commands[command])
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\typer\main.py", line 859, in run
    app()
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\typer\main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\typer\main.py", line 497, in wrapper
    return callback(**use_params)  # type: ignore
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\spikex\cli\create.py", line 62, in create_wikigraph
    wg = WikiGraph.build(**kwargs)
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\spikex\wikigraph\wikigraph.py", line 61, in build
    p, r, d, c, cl = _make_graph_components(**kwargs)
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\spikex\wikigraph\wikigraph.py", line 278, in _make_graph_components
    pprops = _get_pprops(**kwargs)
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\spikex\wikigraph\wikigraph.py", line 316, in _get_pprops
    for pageid, prop, value in iter_pprops_data:
  File "C:\Users\Friedrich.Schmidt\Anaconda3\envs\ml\lib\site-packages\spikex\wikigraph\dumptools.py", line 211, in _parse_wiki_sql_dump
    ) as pbar, compression_wrapper(compress_obj, "rb") as decompress_obj:
TypeError: compression_wrapper() missing 1 required positional argument: 'compression'

Additonal Information

https://github.com/RaRe-Technologies/smart_open/blob/develop/smart_open/compression.py -> Line 106:
def compression_wrapper(file_obj, mode, compression):

The current "compression_wrapper" function actually expects another argument called "compression", which is not passed at the moment: compression_wrapper(compress_obj, "rb")

I fixed the error locally by adding the missing argument: compression_wrapper(compress_obj, "rb", 'infer_from_extension')

@paoloq
Copy link
Contributor

paoloq commented Jan 28, 2022

Thank you, @Fetzii!
I should've set some bounds on the dependency.
I'll do it asap, but before that, using smart_open < 5.0 is another solution I guess.

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

No branches or pull requests

2 participants