-
Notifications
You must be signed in to change notification settings - Fork 4
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
Cleanup models #632
base: develop
Are you sure you want to change the base?
Cleanup models #632
Conversation
Merge develop to master (GTC-3125 changes)
Merge up (develop -> master) changes including admin id lookup, geostore proxy endpoints
Merge up fix for regions/subregions
modified: app/models/enum/versions.py Not known why this relied on sqlalchemy instead of the vanilla enum module. This bring this file into conformance with the rest of the enums.
Imports from within the project have been non-standard. This standardizes them to always use relative imports. modified: app/models/enum/assets.py modified: app/models/orm/api_keys.py modified: app/models/pydantic/authentication.py modified: app/models/pydantic/downloads.py modified: app/models/pydantic/extent.py modified: app/models/pydantic/political.py modified: app/models/pydantic/query.py modified: app/models/pydantic/sources.py modified: app/models/pydantic/statistics.py modified: app/models/pydantic/symbology.py
There have been two PGType classes in `app/models` directory. One came from the `app/models/enum/creation_options.py` file. The other came from the `app/models/enum/pg_types.py` file. The "creation option" PGType does not appear to be used anywhere within the code and is probably some dead code from a refactor... This enum has two fewer Postgres types than the other -- missing the "timestamp_wtz" and "ARRAY" types... This commit removes the "creation option" PGType while keeping the "pg_types" PGType enum in place. modified: app/models/enum/creation_options.py
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #632 +/- ##
===========================================
- Coverage 79.92% 79.87% -0.06%
===========================================
Files 133 133
Lines 6133 6117 -16
===========================================
- Hits 4902 4886 -16
Misses 1231 1231
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 great, thanks for doing it!
Is there any reason why Contrast it to DatasetMetadata which has Most (every?) asset type's metadata inherits from |
Suggesting some cleanup around the models and enums...
Replace sqlalchemy with vanilla enum
Pretty confident this will be without issue based on the way I have seen it used in the backend codebase... Really used as a way to get a limited set of strings... But worth pointing out that while the sqlalchemy Enum has typing similarity to enum.Enum they also have differences...
Use relative imports everywhere
Across the entire
app/models/
directory there are inconsistent ways of performing imports sometimes looking at relative paths and othertimes looking from the root of the app. Under the assumption that there is no benefit/feature being utilized when performing an "absolute import" all imports have been reshaped to be relative imports.Remove PGType from creation_options enum file
There were two instances of
PGType
- both of typeEnum
but defined in different files. The one that is removed seems redundant or dead... There was a slight difference in the set of enum options but based on my searching of the codebase it is fine to remove the one under thecreation_options.py
file.