JetBrains-Research / pubtrends

Scientific literature explorer. Runs a Pubmed or Semantic Scholar search and allows user to explore high-level structure of result papers
Apache License 2.0
36 stars 2 forks source link

Error type object 'object' has no attr 'dtype' #266

Closed RuslanOm closed 3 years ago

RuslanOm commented 3 years ago

To reproduce bug:

Request query: Can Scientific Impact Be Predicted?

Advanced settings: Semantic Scholar, 100 papers, most cited.

Снимок экрана 2021-07-05 в 16 03 10
olegs commented 3 years ago

Corresponding exception from celery.log:

[2021-07-05 13:53:55,624: ERROR/ForkPoolWorker-1] Task analyze_search_terms[b3c1a6d6-6e91-4599-9dd6-d51bcb9afe5b] raised unexpected: AttributeError("type object 'object' has no attribute 'dtype'")
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/pubtrends/lib/python3.8/site-packages/celery/app/trace.py", line 385, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/user/miniconda3/envs/pubtrends/lib/python3.8/site-packages/celery/app/trace.py", line 650, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/user/pysrc/celery/tasks_main.py", line 40, in analyze_search_terms
    analyzer.analyze_papers(ids, query, task=current_task)
  File "/home/user/pysrc/papers/analyzer.py", line 159, in analyze_papers
    self.cit_df = self.loader.load_citations(self.ids)
  File "/home/user/pysrc/papers/db/ss_postgres_loader.py", line 204, in load_citations
    citations = pd.DataFrame(cursor.fetchall(),
  File "/home/user/miniconda3/envs/pubtrends/lib/python3.8/site-packages/pandas/core/frame.py", line 490, in __init__
    mgr = init_dict({}, index, columns, dtype=dtype)
  File "/home/user/miniconda3/envs/pubtrends/lib/python3.8/site-packages/pandas/core/internals/construction.py", line 239, in init_dict
    val = construct_1d_arraylike_from_scalar(np.nan, len(index), nan_dtype)
  File "/home/user/miniconda3/envs/pubtrends/lib/python3.8/site-packages/pandas/core/dtypes/cast.py", line 1440, in construct_1d_arraylike_from_scalar
    dtype = dtype.dtype
AttributeError: type object 'object' has no attribute 'dtype'
olegs commented 3 years ago

@RuslanOm Can you change the issue title so that developer can see what's the problem without looking into the issue content? Issue titles should be self-describing whenever possible.

olegs commented 3 years ago

According to the ss_postgres_loader.py code and specific line it was fixed in b63b44c. Closing as obsolete. Works well in the build version 0.16.1052 built on 2021-07-19.