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

Fix bug with trailing 0 in CIK #128

Merged
merged 1 commit into from
Sep 30, 2023
Merged

Fix bug with trailing 0 in CIK #128

merged 1 commit into from
Sep 30, 2023

Conversation

jadchaar
Copy link
Owner

@jadchaar jadchaar commented Sep 30, 2023

In the orchestrator, I am using strip("0") to clean the CIK and format the URL for archive download. Filings for CIKs ending with 0 fail to download due to this issue since I am malforming a correct CIK. The fix is to change the orchestrator to clean the CIK using lstrip("0").

In addition to a regression unit test, I also validated that the code snippet below does not work on v5.0 but works after this patch:

from sec_edgar_downloader import Downloader

downloader = Downloader("Jad Chaar", "jad.chaar@gmail.com")

downloaded = downloader.get("424B2", "0000312070", limit=1)
print(downloaded)

Closes: #126

@codecov
Copy link

codecov bot commented Sep 30, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (c162336) 100.00% compared to head (6779d2d) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #128   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          218       218           
  Branches        30        30           
=========================================
  Hits           218       218           
Files Coverage Δ
sec_edgar_downloader/_orchestrator.py 100.00% <100.00%> (ø)
sec_edgar_downloader/_version.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jadchaar jadchaar merged commit 3e8bad5 into master Sep 30, 2023
21 checks passed
@jadchaar jadchaar deleted the fix-trailing-zero-bug branch September 30, 2023 18:52
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

Successfully merging this pull request may close these issues.

Error in URLs for certain accession_numbers
1 participant