8000 'filter' object has no attribute 'pop' · Issue #512 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

'filter' object has no attribute 'pop' #512

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

Closed
mrreyes512 opened this issue Oct 18, 2019 · 4 comments
Closed

'filter' object has no attribute 'pop' #512

mrreyes512 opened this issue Oct 18, 2019 · 4 comments

Comments

@mrreyes512
Copy link

In the export.py line 46

I'm getting the below error...

Traceback (most recent call last):
  File "export.py", line 84, in <module>
    main()
  File "export.py", line 56, in main
    view = views.pop()
AttributeError: 'filter' object has no attribute 'pop'

I'm calling it as illustrated below:

python export.py --csv --file export1.csv `report_ID`

Do i need to specify any further information?

@andrewbcooper
Copy link
andrewbcooper commented Jan 8, 2020

I had the same issue and found this on Stackoverflow. Are you using Python 3.x? If so, edit the code to be:

views = filter(lambda x: x.id == args.resource_id,
TSC.Pager(server.views.get))
views = list(views)
view = views.pop()

https://stackoverflow.com/questions/34820657/filter-object-has-no-attribute-pop

@JoeyKwok
Copy link

Mine returns 'IndexError: pop from empty list', using python 3.6 corrected with list.
I am using view.id as report_ID. Am I using the correct one?

@bcantoni bcantoni added the bug label Sep 1, 2020
@bcantoni
Copy link
Contributor
bcantoni commented Sep 1, 2020

Confirmed this is still a bug in the sample. There are 2 issues here:

  • Making the sample work correctly in Python 3.x (as @andrewbcooper points out)
  • Better handling for the case where the resource_id is not found (as @JoeyKwok points out)

@jacalata
Copy link
Contributor
jacalata commented Jun 7, 2022

The updated samples should cover this nicely.

@jacalata jacalata closed this as completed Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0