Skip to content

Conversation

@aaarendt
Copy link
Contributor

@aaarendt aaarendt commented Jan 1, 2026

This PR enhances the API query capabilities so that information from tables related to point and layer data can be easily included in the standard area or filter queries. I suggest a verbose Boolean that returns only the base table columns (other than unnecessary foreign key values) for FALSE, and all other information in any foreign key related tables for TRUE.

In order to make this work for both area and filter queries, all query logic needed to use the sqlalchemy ORM. In the previous PR I had pure SQL to handle the new postgis area calculations. These are now replaced with equivalent ORM approaches.

In the notebook examples I wanted to be able to ask, "What types of data are available for just the layer or point data?". This required defining all_types uniquely for the Point and Layer classes so that only the types joined with those tables were returned.

A small error was corrected for all_instruments where non-distinct values were being returned.

Small updates to the Lambda handler were needed to accommodate the verbose keyword.

Additional examples are added to the example notebook, still in draft form. We will continue updating gallery examples in a separate PR.

This PR makes use of the Claude Sonnet 4.5 coding agent.

@aaarendt aaarendt added the enhancement New feature or request label Jan 1, 2026
@codecov
Copy link

codecov bot commented Jan 1, 2026

Codecov Report

❌ Patch coverage is 67.59259% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.25%. Comparing base (adb9033) to head (55b19fb).

Files with missing lines Patch % Lines
snowexsql/api.py 71.42% 26 Missing ⚠️
snowexsql/lambda_handler.py 40.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
+ Coverage   59.68%   60.25%   +0.56%     
==========================================
  Files          23       23              
  Lines        1146     1195      +49     
==========================================
+ Hits          684      720      +36     
- Misses        462      475      +13     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aaarendt
Copy link
Contributor Author

aaarendt commented Jan 2, 2026

I've added a new api function get_sites that allows for easy querying of the sites table. This was a requirement of the microstructure tutorial so we can make a map of a subset of sites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants