YangCatalog / backend

YANG Catalog's REST API and internal module processing pipeline
https://yangcatalog.org
Apache License 2.0
2 stars 11 forks source link

refactor: replace implicitly structured dicts #736

Closed bskqd closed 1 year ago

bskqd commented 1 year ago

Replaced implicitly structured dicts with either dataclasses or TypedDicts, refactored some code, and moved a few functions related to Elasticsearch from utility/util.py to utility/elasticsearch_util.py

NOTE: if you have some other dicts that should be changed in mind, please let me know

resolves #693

codecov[bot] commented 1 year ago

Codecov Report

Merging #736 (dd81d71) into develop (a5d4a0d) will increase coverage by 0.07%. The diff coverage is 56.59%.

:exclamation: Current head dd81d71 differs from pull request most recent head 9636e0b. Consider uploading reports for the commit 9636e0b to get more accurate results

@@             Coverage Diff             @@
##           develop     #736      +/-   ##
===========================================
+ Coverage    77.75%   77.82%   +0.07%     
===========================================
  Files          112      115       +3     
  Lines        12526    12566      +40     
===========================================
+ Hits          9739     9780      +41     
+ Misses        2787     2786       -1     
Impacted Files Coverage Δ
parseAndPopulate/models/directory_paths.py 100.00% <ø> (ø)
utility/elasticsearch_util.py 19.13% <19.13%> (ø)
parseAndPopulate/populate.py 83.33% <33.33%> (ø)
parseAndPopulate/file_hasher.py 72.47% <66.66%> (ø)
parseAndPopulate/groupings.py 68.32% <77.77%> (+0.19%) :arrow_up:
utility/util.py 82.75% <83.33%> (+27.97%) :arrow_up:
redisConnections/redis_users_connection.py 96.59% <95.00%> (+0.03%) :arrow_up:
api/receiver.py 55.50% <100.00%> (ø)
parseAndPopulate/models/vendor_modules.py 100.00% <100.00%> (ø)
parseAndPopulate/modules.py 85.39% <100.00%> (+0.08%) :arrow_up:
... and 11 more