markhoerth / dremio_client

Apache License 2.0
31 stars 25 forks source link

Use the python module to change an ACL or the sql of a dataset #41

Closed insatomcat closed 4 years ago

insatomcat commented 4 years ago

Dremio client version: 0.10.1 Dremio version: 4.1.8 Python version: 3.8.2 Operating System: docker/python:3

Description

I'm trying to write to the dremio catalog with the python module (not the utility). For instance changing an ACL or a sql definition.

What I Did

from dremio_client import init
client = init()
catalog = client.data

Then I tried to change the attribute and then commit...

a = catalog.BDF.example_bug_round.get()
b = a.meta
b.sql = "SELECT * FROM bug_round_test limit 3000" 
setattr(a,"meta",b)
a.commit()

But commit seems deactivated (_dirty=False?)

So I don't even know if it's possible right now.

Can you please advise ? Thank you.

rymurr commented 4 years ago

Hey @insatomcat the _dirty flag isn't set automatically yet (on my todo list). You can set it by hand. From your example above a._dirty = True

insatomcat commented 4 years ago

Thanks