Skip to content

Building a remote lazy DF with client- and server-side filtering #11096

Answered by Sara25776
YStrauch asked this question in Q&A
Discussion options

You must be logged in to vote

We can use alias property to achieve this

import ibis
from ibis import _
ibis.options.interactive = True
import uuid

# Need to remove '-' as it makes table name invalid, also prefix with some string as few uuid fails. For ex 57e5f11339d04ff683f5a1da500dafc0
dataset_id = str(uuid.uuid4()).replace("-", "") 
dataset_id = f"client_{dataset_id}"

table = ibis.examples.penguins.fetch(table_name="penguins")
df = table.filter(table.flipper_length_mm == 181)

client_query = f"select * from {dataset_id} where species='Adelie'"
df = df.alias(dataset_id).sql(client_query)
df

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Sara25776
Comment options

Answer selected by YStrauch
@YStrauch
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants