You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm, good question. The way the SQL layer works is to:
Intercept a query request that is formatted as a string
Parse to AST and validate the SQL to ensure it's a query that can be safely done in a private way
Rewrite the query in the AST to ensure privacy. For example, add reservoir sampling or bounds clipping
Convert the rewritten query to a string
Execute the rewritten query string against the database connection
Steps 2-4 need to be handled by SmartNoise to make sure we don't violate privacy. But it should be straightforward to feed step 1 with the output from an ORM-style query. As long as the ORM layer doesn't generate queries which are inconsistent with privacy, it will work. I believe SQLAlchemy allows you to grab a SQL query string from the ORM query, so it should "just work". I will try to whip up a sample later next week. I don't know if it's possible to do that from Pandas, though. If there is a way from Pandas to grab the SQL generated from the filter/groupby methods, it would presumably work.
eg supporting filter/groupby methods on the returned data object
should just be a matter of converting to AST under the hood?
The text was updated successfully, but these errors were encountered: