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

Cannot get tables with filters applied #36

Open
funkymonkeymonk opened this issue Mar 28, 2021 · 4 comments
Open

Cannot get tables with filters applied #36

funkymonkeymonk opened this issue Mar 28, 2021 · 4 comments
Assignees
Labels

Comments

@funkymonkeymonk
Copy link

Heya,

I ran a get table on my filtered view and I'm having some issues.

File "/home/codespace/.local/lib/python3.8/site-packages/codaio/coda.py", line 784, in get_table
    return Table.from_json(table_data, document=self)
  File "/home/codespace/.local/lib/python3.8/site-packages/codaio/coda.py", line 699, in from_json
    return cls(**js, document=document)
TypeError: __init__() got an unexpected keyword argument 'filter'

Digging into the code a bit it looks like the Table class doesn't have support for a filter argument here which why I'm getting this error. I'm happy to do the add myself but I'm just relearning python after nearly 10 years so some guidance would be appreciated.

@licht1stein
Copy link
Owner

Hi @funkymonkeymonk thanks for catching that. Try to make a pull request and I'll be more than happy to review it. If a field is missing you just need to add it like the other fields on the Table class.

@licht1stein
Copy link
Owner

I checked the API docs, since filter is a dictionary:

"filter": {
    "valid": true,
    "isVolatile": false,
    "hasUserFormula": false,
    "hasTodayFormula": false,
    "hasNowFormula": false
}

You first need to introduce a Filter class, then add it as an attribute to the Table class.

attrs makes it all quite simple, just take the Column class as an example.

@jrjurman-jellyfish
Copy link

jrjurman-jellyfish commented Jan 13, 2022

Is this still an issue? It looks like it was resolved in #51 , and locally updating the library resolved this issue for my team.

@funkymonkeymonk
Copy link
Author

I don't actively used coda anymore so it wouldn't impact me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants