0

我正在使用 python 3.8 将大型 CSV 文件导入具有 odo 函数的 mysql 表中。

@profilehooks.timecall
def useOdo(table_name, uri):
    odo.odo('tmp.csv', '%s::%s' % (uri, table_name))

这会产生以下错误。

Traceback (most recent call last):
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\profilehooks.py", line 801, in __call__
    return fn(*args, **kw)
  File "C:/Users/MyUser/PycharmProjects/MyImportTest/test3.py", line 33, in using_odo
    odo('tmp.csv', '%s::%s' % (uri, table_name))
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\odo\odo.py", line 91, in odo
    return into(target, source, **kwargs)
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\multipledispatch\dispatcher.py", line 278, in __call__
    return func(*args, **kwargs)
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\odo\into.py", line 43, in wrapped
    return f(*args, **kwargs)
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\odo\into.py", line 149, in into_string_string
    return into(a, resource(b, **kwargs), **kwargs)
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\multipledispatch\dispatcher.py", line 278, in __call__
    return func(*args, **kwargs)
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\odo\into.py", line 43, in wrapped
    return f(*args, **kwargs)
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\odo\into.py", line 138, in into_string
    dshape = discover(b)
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\multipledispatch\dispatcher.py", line 278, in __call__
    return func(*args, **kwargs)
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\odo\backends\csv.py", line 333, in discover_csv
    df = csv_to_dataframe(c, nrows=nrows, **kwargs)
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\odo\backends\csv.py", line 248, in csv_to_dataframe
    return _csv_to_dataframe(c, dshape=dshape, chunksize=chunksize,
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\odo\backends\csv.py", line 299, in _csv_to_dataframe
    kwargs = keyfilter(keywords(pd.read_csv).__contains__, kwargs)
  File "C:\Users\MyUser\PycharmProjects\MyImportTest\venv\lib\site-packages\odo\utils.py", line 128, in keywords
    return inspect.getargspec(func).args
  File "C:\Users\MyUser\AppData\Local\Programs\Python\Python38\lib\inspect.py", line 1083, in getargspec
    raise ValueError("Function has keyword-only parameters or annotations"
ValueError: Function has keyword-only parameters or annotations, use inspect.signature() API which can support them
python-BaseException

Process finished with exit code 1

Coudn找不到太多关于这个。任何人都可以帮忙吗?

4

0 回答 0