Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Emergent mode fails with AttributeError: 'str' object has no attribute 'isocalendar' #227

@pjlegato

Description

@pjlegato

Describe the bug
When running with -emt, CSV input, and a date field given in the required format YYYY/MM/DD, it crashes with:

  File "/Users/paul/src/pyGrams/scripts/tfidf_reduce.py", line 77, in <listcomp>
    [d.isocalendar() for d in dates]]
AttributeError: 'str' object has no attribute 'isocalendar'

The code does not appear to be parsing the input date string as a date object; it attempts to call date methods on a string.

To Reproduce
Steps to reproduce the behavior:

  1. Create a CSV input file with a date field in YYYY/MM/DD format
  2. Run python pygrams.py -emt -ds=posts.csv -dh='date' -th text > emergent.out
  3. Crashes with above error

Expected behavior
Should not crash; should calculate emerging terms.

Desktop (please complete the following information):

  • OS: Mac OS
  • Python 3.7.2

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions