-
Notifications
You must be signed in to change notification settings - Fork 26
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
feature/ingestion-models #26
Conversation
docstrings look better
Codecov Report
@@ Coverage Diff @@
## main #26 +/- ##
==========================================
+ Coverage 98.68% 98.91% +0.22%
==========================================
Files 17 20 +3
Lines 458 551 +93
==========================================
+ Hits 452 545 +93
Misses 6 6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍹 The Update (preview) for stack CouncilDataProjectServiceAccount/cdp-infrastructure/cdp-example was successful.
Resource Changes
Name Type Operation
+ cdp-example-firestore-service gcp:projects/service:Service create
+ matter_file-matter_ref_ASCENDING_name_ASCENDING gcp:firestore/index:Index create
+ event-body_ref_ASCENDING_event_datetime_ASCENDING gcp:firestore/index:Index create
+ event-body_ref_ASCENDING_event_datetime_DESCENDING gcp:firestore/index:Index create
+ matter_status-matter_ref_ASCENDING_update_datetime_DESCENDING gcp:firestore/index:Index create
+ event_minutes_item_file-event_minutes_item_ref_ASCENDING_name_ASCENDING gcp:firestore/index:Index create
+ transcript-session_ref_ASCENDING_confidence_DESCENDING gcp:firestore/index:Index create
+ cdp-infrastructure-cdp-example pulumi:pulumi:Stack create
+ cdp-example-firestore-app gcp:appengine/application:Application create
+ event_minutes_item-event_ref_ASCENDING_index_ASCENDING gcp:firestore/index:Index create
+ event_minutes_item-event_ref_ASCENDING_index_DESCENDING gcp:firestore/index:Index create
+ matter_status-matter_ref_ASCENDING_update_datetime_ASCENDING gcp:firestore/index:Index create
+ cdp-example CDPStack create
+ cdp-example-speech-service gcp:projects/service:Service create
+ cdp-example-compute-service gcp:projects/service:Service create
+ transcript-session_ref_ASCENDING_created_DESCENDING gcp:firestore/index:Index create
Oh and @isaacna you were totally correct. There is really no way this could have been done programmatically top-down or something. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built the docs and the event ingestion model page looks great! I agree with making the EventMinutesItem
optional so we can have a more minimal version of the data. Also agree with the other minor tweaks with the database and ingestion models.
Also just out of curiosity, how did you get code coverage to count the ingestion model lines? Is it working now because the models are being used from the test
subdirectory?
Yea I think its just because they are being used / initialized somewhere. |
I wasn't able to generate the docs. I got |
Hm I guess it just doesn't working trying to create examples via classmethods |
@tohuynh I just pushed a very small to change to explicitely in UTF-8, can you retry this branch and if it fails can I get the full stack trace? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍹 The Update (preview) for stack CouncilDataProjectServiceAccount/cdp-infrastructure/cdp-example was successful.
Resource Changes
Name Type Operation
+ cdp-example-compute-service gcp:projects/service:Service create
+ event-body_ref_ASCENDING_event_datetime_DESCENDING gcp:firestore/index:Index create
+ matter_status-matter_ref_ASCENDING_update_datetime_DESCENDING gcp:firestore/index:Index create
+ matter_status-matter_ref_ASCENDING_update_datetime_ASCENDING gcp:firestore/index:Index create
+ transcript-session_ref_ASCENDING_created_DESCENDING gcp:firestore/index:Index create
+ cdp-infrastructure-cdp-example pulumi:pulumi:Stack create
+ event-body_ref_ASCENDING_event_datetime_ASCENDING gcp:firestore/index:Index create
+ event_minutes_item-event_ref_ASCENDING_index_ASCENDING gcp:firestore/index:Index create
+ event_minutes_item-event_ref_ASCENDING_index_DESCENDING gcp:firestore/index:Index create
+ transcript-session_ref_ASCENDING_confidence_DESCENDING gcp:firestore/index:Index create
+ cdp-example CDPStack create
+ cdp-example-firestore-app gcp:appengine/application:Application create
+ event_minutes_item_file-event_minutes_item_ref_ASCENDING_name_ASCENDING gcp:firestore/index:Index create
+ matter_file-matter_ref_ASCENDING_name_ASCENDING gcp:firestore/index:Index create
+ cdp-example-speech-service gcp:projects/service:Service create
+ cdp-example-firestore-service gcp:projects/service:Service create
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. And thanks for fixing the make docs
error. It works for me now.
cdp_backend/pipeline/__init__.py
Outdated
|
||
"""Pipeline package for cdp_backend.""" | ||
|
||
from .ingestion_models import EventIngestionModel # noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also import the other ingestion models so they could be used in cookiecutter-cdp-deployment
or it is not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah. I think after reading this comment, I would rather just remove this shortener rather than make all of them shorter.
i.e. users would have to from cdp_backend.pipeline.ingestion_models import EventIngestionModel
rather than current (from cdp_backend.pipeline import EventIngestionModel
)
Keeping them all standard rather than making Event special makes more sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍹 The Update (preview) for stack CouncilDataProjectServiceAccount/cdp-infrastructure/cdp-example was successful.
Resource Changes
Name Type Operation
+ cdp-example-firestore-app gcp:appengine/application:Application create
+ transcript-session_ref_ASCENDING_created_DESCENDING gcp:firestore/index:Index create
+ cdp-example-firestore-service gcp:projects/service:Service create
+ cdp-example-compute-service gcp:projects/service:Service create
+ event_minutes_item_file-event_minutes_item_ref_ASCENDING_name_ASCENDING gcp:firestore/index:Index create
+ cdp-infrastructure-cdp-example pulumi:pulumi:Stack create
+ cdp-example-speech-service gcp:projects/service:Service create
+ event-body_ref_ASCENDING_event_datetime_ASCENDING gcp:firestore/index:Index create
+ event-body_ref_ASCENDING_event_datetime_DESCENDING gcp:firestore/index:Index create
+ matter_status-matter_ref_ASCENDING_update_datetime_ASCENDING gcp:firestore/index:Index create
+ transcript-session_ref_ASCENDING_confidence_DESCENDING gcp:firestore/index:Index create
+ cdp-example CDPStack create
+ event_minutes_item-event_ref_ASCENDING_index_ASCENDING gcp:firestore/index:Index create
+ event_minutes_item-event_ref_ASCENDING_index_DESCENDING gcp:firestore/index:Index create
+ matter_file-matter_ref_ASCENDING_name_ASCENDING gcp:firestore/index:Index create
+ matter_status-matter_ref_ASCENDING_update_datetime_DESCENDING gcp:firestore/index:Index create
Pull request recommendations:
Resolves #10
Building off of @isaacna's work in #20, I first went through how we are currently accepting data in
cdptools
and then went through and figured out what we would need to add and where to fully utilize the new db schema.I also edited the base db models and adjusted primary keys where I realized didn't make sense, set some parameters to required as we can either calc / generate them on the fly during the pipeline etc, and fixed documentation.
Finally, I added a bin script to generate documentation specifically for the
EventIngestionModel
class using the two examples I laid out in thepipeline.ingestion_models
module (EXAMPLE_MINIMAL_EVENT
andEXAMPLE_FILLED_EVENT
).To see documentation view of these examples:
git clone https://github.com/CouncilDataProject/cdp-backend.git cd cdp-backend git checkout feature/ingestion-models pip install .[dev] make docs
and navigate to "Event Data Ingestion Model".
Other random note: I made some comments about "generation of
router_string
on the person class", I looked up how to remove accent characters and seems very possible for us to create such a generator prior to document upload so should be good to go there. StackOverflow examplePinging @nniiicc because I think you will like the auto-genned documentation for the ingestion model. Relates back to Packaging Municipal Legislative Event Data for Reuse & Exchange. Speaking of which, where is that poster? The abstract is in zenodo but not the poster and I remember I really liked it.
Thanks for contributing!