Cannot get field attributes

Open
#247 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
database

Research direction

Reproduce the problem with the shown Datasource.from_file('myDS.tdsx') example and inspect how the datasource's fields are returned. Confirm the expected behavior by checking whether each field should expose attributes such as name rather than only an id string; done means the example can access field attributes without AttributeError.

Written by the indexing model from the issue text.

Description

I have a tdsx of a published datasource (which is live to a virtual connection (which is extracts only) to AWS Athena).

I am attempting to use Datasource.Fields attributes but can't because instead of a full Field object I only get a string which is the id.

This will print the id:
ds = Datasource.from_file('myDS.tdsx') for f in newDS.fields: print(f)

This throws an error:
ds = Datasource.from_file('myDS.tdsx') for f in newDS.fields: print(f.name)
AttributeError: 'str' object has no attribute 'name'
The same error occurs with all attributes (but of course the attribute changes to whatever I specify)

Dominant language
Python
Stars
363
Forks
183
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tableau/document-api-python

All issues in tableau/document-api-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.