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

REST feature layer extractor #48

Merged
merged 47 commits into from
Sep 22, 2023
Merged

REST feature layer extractor #48

merged 47 commits into from
Sep 22, 2023

Conversation

jacobdadams
Copy link
Member

Adding a new extractor to load data from a feature layer in a REST map or feature service endpoint.

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Patch coverage: 99.25% and project coverage change: +1.09% 🎉

Comparison is base (8cfe1e9) 90.75% compared to head (5230fa3) 91.85%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #48      +/-   ##
==========================================
+ Coverage   90.75%   91.85%   +1.09%     
==========================================
  Files           7        7              
  Lines         898     1031     +133     
  Branches      128      146      +18     
==========================================
+ Hits          815      947     +132     
  Misses         74       74              
- Partials        9       10       +1     
Files Changed Coverage Δ
src/palletjack/extract.py 92.14% <99.22%> (+4.52%) ⬆️
src/palletjack/utils.py 94.84% <100.00%> (+0.06%) ⬆️

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

README.md Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
Copy link
Member

@steveoh steveoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks really useful. nice work.

src/palletjack/extract.py Outdated Show resolved Hide resolved
Copy link
Member

@steveoh steveoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are some nice improvements. thanks for doing those.

I wonder, since you are using so many properties of the json response, that it might be best to create a class to represent that object that takes the response dictionary as a constructor and hydrates all the fields you are interested in. you could have a private method that safely pulls values out of the dictionary to set properties and some instance methods that return true or false if the service supports what it needs. yada yada. what do you think?

src/palletjack/extract.py Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
tests/test_extract.py Outdated Show resolved Hide resolved
tests/test_extract.py Outdated Show resolved Hide resolved
tests/test_extract.py Outdated Show resolved Hide resolved
tests/test_extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
@jacobdadams jacobdadams marked this pull request as draft June 29, 2023 23:32
@jacobdadams
Copy link
Member Author

Ok, I think I've addressed all the different ideas and suggestions (minus creating a properties class...). Do you guys know of a non-OBJECTID service I can test the arbitrarily-named object id stuff against?

@stdavis
Copy link
Member

stdavis commented Jun 30, 2023

Do you guys know of a non-OBJECTID service I can test the arbitrarily-named object id stuff against?

Here's one that I just put up. Let me know when you are done testing so that I can clean it up. I just download the dataset as a shapefile and then re-uploaded it.

https://services1.arcgis.com/99lidPhWCzftIe9K/ArcGIS/rest/services/Utah_County_Boundaries_TEST/FeatureServer/0

@jacobdadams
Copy link
Member Author

Do you guys know of a non-OBJECTID service I can test the arbitrarily-named object id stuff against?

Here's one that I just put up. Let me know when you are done testing so that I can clean it up. I just download the dataset as a shapefile and then re-uploaded it.

https://services1.arcgis.com/99lidPhWCzftIe9K/ArcGIS/rest/services/Utah_County_Boundaries_TEST/FeatureServer/0

Ok, duh, I could have done that :) But thank you! It works like it should.

@jacobdadams jacobdadams marked this pull request as ready for review June 30, 2023 20:49
@jacobdadams jacobdadams marked this pull request as draft July 6, 2023 15:44
Copy link
Member

@steveoh steveoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is authenticated access to private layers on the radar?

@jacobdadams
Copy link
Member Author

Is authenticated access to private layers on the radar?

I hadn't thought about that, but that would be a good idea. I'll add it to the list while I'm rethinking/refactoring.

src/palletjack/extract.py Outdated Show resolved Hide resolved
@jacobdadams jacobdadams marked this pull request as ready for review August 21, 2023 21:38
@jacobdadams
Copy link
Member Author

Ok, I think this is finally ready. I added access to the retry values as global variables that can be set by the client programs in case the default time/retries are not enough for a given application.

@jacobdadams
Copy link
Member Author

@stdavis and @steveoh, I'd love a final look at this and any last thoughts you've got.

Copy link
Member

@steveoh steveoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great. a few comments for polish.

src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
src/palletjack/extract.py Outdated Show resolved Hide resolved
tests/test_utils.py Outdated Show resolved Hide resolved
tests/test_utils.py Outdated Show resolved Hide resolved
tests/test_extract.py Outdated Show resolved Hide resolved
@jacobdadams jacobdadams merged commit 96fab9b into main Sep 22, 2023
5 checks passed
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.

3 participants