FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fixes#47 Implement ability to query fields used on a worksheet by graysonarts · Pull Request #54 · tableau/document-api-python · GitHub

fixes#47 Implement ability to query fields used on a worksheet - #54

Merged
graysonarts merged 14 commits into
tableau:developmentfrom
graysonarts:feature-47-fields-in-use
Jul 21, 2016
Merged

fixes#47 Implement ability to query fields used on a worksheet#54
graysonarts merged 14 commits into
tableau:developmentfrom
graysonarts:feature-47-fields-in-use

Conversation

Copy link
Copy Markdown
Contributor

No description provided.

t8y8 commented Jul 19, 2016

Copy link
Copy Markdown
Contributor

This is a large review so I'll need some time to wrap my head around it (Nice find on the hidden bug in missing fields though!)

Leaving some superficial comments on my first pass

Comment thread test/assets/datasource_test.twb Outdated
</window>
</windows>
<thumbnails>
<thumbnail height='104' name='Sheet 1' width='144'>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Clear out the thumbnails, I think they'll just get regenerated as we iterate on these in the future and it keeps the diff a little more managable.

Comment thread tableaudocumentapi/multilookup_dict.py Outdated
return dict.__getitem__(self, key)


class PredicatedDictionary(object):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think the code is here is fine, but I'm a little fuzzy on the need for a new type -- would a regular dictionary or data structure do?

It just makes the code read a little more complicated for new contributors. Not a strong objection, mostly curiosity.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

bah, this was left over from the previous approach. I'll remove it.


def _is_used_by_worksheet(names, field):
return any((True for y in names if y in field.worksheets))
return any((y for y in names if y in field.worksheets))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You can murder even more ()'s -- there's an implicit generator inside the fucntion call to any, so it can just be any(i for i in iterable if condition)

Comment thread tableaudocumentapi/datasource.py Outdated


class FieldDictionary(MultiLookupDict):
def found_in(self, name):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

And let the bikeshedding begin!

found_in?
used_in?
used_by?
on_some_level_of_detail_somewhere_in?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

yeah found_in seems a bit not right to me. I think used_by hits the right level of obviousness, though maybe we need "used_by_worksheet" to be specific that this only works on worksheets (eventually a worksheet object, but for now, just the name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

used_by_sheet() feels good to me (Or whatever our docs call a 'sheet' that is only a 'sheet' and not a dashboard or story)

t8y8 commented Jul 20, 2016

Copy link
Copy Markdown
Contributor

🚀🚀🚀 (LGTM)

I'm struggling with the basestring thing, I can't put my finger on why (I might prefer explicit py2/py3 checking but I may also just need sleep). I'll submit a PR if the 'better' way ever hits me.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL