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

Dockets file not working for sqlite #23

Open
sabzo opened this issue May 30, 2023 · 1 comment
Open

Dockets file not working for sqlite #23

sabzo opened this issue May 30, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sabzo
Copy link
Contributor

sabzo commented May 30, 2023

For some reason, the Dockets file when read into sqllite has no keys:

image

This is causing "key doesn't exist" errors

to reproduce:

initialize nocap with .bz2 files

# get file paths
opinions_fn = f'{path}opinions-2022-12-31.csv.bz2'
courts_fn = f'{path}courts-2022-12-31.csv.bz2'
dockets_fn = f'{path}dockets-2022-12-31.csv.bz2'
opinion_clusters_fn = f'{path}opinion-clusters-2022-12-31.csv.bz2'
citation_fn = f'{path}citation-map-2022-12-31.csv.bz2'

# initalize nc
nc = lnc.NoCap(opinions_fn, opinion_clusters_fn, courts_fn, dockets_fn, citation_fn)

# check length of docket keys
len(list(nc._df_dockets.keys()))
@sabzo sabzo added the bug Something isn't working label May 30, 2023
@sabzo sabzo self-assigned this May 30, 2023
@sabzo
Copy link
Contributor Author

sabzo commented May 30, 2023

error looks like:

KeyError: 62526835
DEBUG:root:process_df: client.map
ERROR:root:62428550
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lil_nocap/__init__.py", line 459, in start
    result = future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lil_nocap/__init__.py", line 337, in process_df
    docket_rows = list(map(lambda x: dockets[int(x["docket_id"])], cluster_rows))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/lil_nocap/__init__.py", line 337, in <lambda>
    docket_rows = list(map(lambda x: dockets[int(x["docket_id"])], cluster_rows))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sqlitedict.py", line 305, in __getitem__
    raise KeyError(key)
KeyError: 62428550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant