-
Notifications
You must be signed in to change notification settings - Fork 182
Add a version check to provide good errors on version incompatibility #59
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
<?xml version='1.0' encoding='utf-8' ?> | ||
|
||
<!-- build 9300.16.0603.2240 --> | ||
<workbook source-build='9.3.3 (9300.16.0603.2240)' source-platform='mac' version='9.3' xmlns:user='http://www.tableausoftware.com/xml/user'> | ||
<preferences> | ||
<preference name='ui.encoding.shelf.height' value='24' /> | ||
<preference name='ui.shelf.height' value='26' /> | ||
</preferences> | ||
<datasources> | ||
<datasource inline='true' name='datasource_test' version='9.3'> | ||
<connection authentication='username-password' class='postgres' dbname='TestV1' odbc-native-protocol='yes' port='5432' server='postgres91.test.tsi.lan' username='test'> | ||
<relation name='xy' table='[public].[xy]' type='table' /> | ||
<metadata-records> | ||
<metadata-record class='column'> | ||
<remote-name>a</remote-name> | ||
<remote-type>130</remote-type> | ||
<local-name>[a]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>a</remote-alias> | ||
<ordinal>1</ordinal> | ||
<local-type>string</local-type> | ||
<aggregation>Count</aggregation> | ||
<width>255</width> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_WVARCHAR"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_WCHAR"</attribute> | ||
<attribute datatype='string' name='TypeIsVarchar'>"true"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
<metadata-record class='column'> | ||
<remote-name>x</remote-name> | ||
<remote-type>3</remote-type> | ||
<local-name>[x]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>x</remote-alias> | ||
<ordinal>2</ordinal> | ||
<local-type>integer</local-type> | ||
<aggregation>Sum</aggregation> | ||
<precision>10</precision> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_INTEGER"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_SLONG"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
<metadata-record class='column'> | ||
<remote-name>y</remote-name> | ||
<remote-type>3</remote-type> | ||
<local-name>[y]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>y</remote-alias> | ||
<ordinal>3</ordinal> | ||
<local-type>integer</local-type> | ||
<aggregation>Sum</aggregation> | ||
<precision>10</precision> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_INTEGER"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_SLONG"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
</metadata-records> | ||
</connection> | ||
<aliases enabled='yes' /> | ||
<column datatype='integer' name='[Number of Records]' role='measure' type='quantitative' user:auto-column='numrec'> | ||
<calculation class='tableau' formula='1' /> | ||
</column> | ||
<column caption='A' datatype='string' name='[a]' role='dimension' type='nominal' /> | ||
<column caption='X' datatype='integer' name='[x]' role='measure' type='quantitative' /> | ||
<column caption='Y' datatype='integer' name='[y]' role='measure' type='quantitative' /> | ||
<layout dim-ordering='alphabetic' dim-percentage='0.48' measure-ordering='alphabetic' measure-percentage='0.52' show-structure='true' /> | ||
<semantic-values> | ||
<semantic-value key='[Country].[Name]' value='"United States"' /> | ||
</semantic-values> | ||
</datasource> | ||
</datasources> | ||
<worksheets> | ||
<worksheet name='Sheet 1'> | ||
<table> | ||
<view> | ||
<datasources> | ||
<datasource name='datasource_test' /> | ||
</datasources> | ||
<datasource-dependencies datasource='datasource_test'> | ||
<column caption='A' datatype='string' name='[a]' role='dimension' type='nominal' /> | ||
<column-instance column='[a]' derivation='None' name='[none:a:nk]' pivot='key' type='nominal' /> | ||
</datasource-dependencies> | ||
<aggregation value='true' /> | ||
</view> | ||
<style /> | ||
<panes> | ||
<pane> | ||
<view> | ||
<breakdown value='auto' /> | ||
</view> | ||
<mark class='Automatic' /> | ||
</pane> | ||
</panes> | ||
<rows>[datasource_test].[none:a:nk]</rows> | ||
<cols /> | ||
</table> | ||
</worksheet> | ||
<worksheet name='Sheet 2'> | ||
<table> | ||
<view> | ||
<datasources> | ||
<datasource name='datasource_test' /> | ||
</datasources> | ||
<datasource-dependencies datasource='datasource_test'> | ||
<column caption='SUM(X) + SUM(Y)' datatype='integer' name='[Calculation_3002775091869110273]' role='measure' type='quantitative' user:unnamed='Sheet 2'> | ||
<calculation class='tableau' formula='SUM([x]) + SUM([y])' /> | ||
</column> | ||
<column caption='A' datatype='string' name='[a]' role='dimension' type='nominal' /> | ||
<column-instance column='[a]' derivation='None' name='[none:a:nk]' pivot='key' type='nominal' /> | ||
<column-instance column='[x]' derivation='Sum' name='[sum:x:qk]' pivot='key' type='quantitative' /> | ||
<column-instance column='[Calculation_3002775091869110273]' derivation='User' name='[usr:Calculation_3002775091869110273:qk]' pivot='key' type='quantitative' /> | ||
<column caption='X' datatype='integer' name='[x]' role='measure' type='quantitative' /> | ||
<column caption='Y' datatype='integer' name='[y]' role='measure' type='quantitative' /> | ||
</datasource-dependencies> | ||
<aggregation value='true' /> | ||
</view> | ||
<style /> | ||
<panes> | ||
<pane> | ||
<view> | ||
<breakdown value='auto' /> | ||
</view> | ||
<mark class='Automatic' /> | ||
</pane> | ||
<pane id='1' x-axis-name='[datasource_test].[sum:x:qk]'> | ||
<view> | ||
<breakdown value='auto' /> | ||
</view> | ||
<mark class='Automatic' /> | ||
</pane> | ||
<pane id='2' x-axis-name='[datasource_test].[usr:Calculation_3002775091869110273:qk]'> | ||
<view> | ||
<breakdown value='auto' /> | ||
</view> | ||
<mark class='Automatic' /> | ||
</pane> | ||
</panes> | ||
<rows>[datasource_test].[none:a:nk]</rows> | ||
<cols>([datasource_test].[sum:x:qk] + [datasource_test].[usr:Calculation_3002775091869110273:qk])</cols> | ||
</table> | ||
</worksheet> | ||
</worksheets> | ||
<windows source-height='28'> | ||
<window class='worksheet' name='Sheet 1'> | ||
<cards> | ||
<edge name='left'> | ||
<strip size='160'> | ||
<card type='pages' /> | ||
<card type='filters' /> | ||
<card type='marks' /> | ||
</strip> | ||
</edge> | ||
<edge name='top'> | ||
<strip size='2147483647'> | ||
<card type='columns' /> | ||
</strip> | ||
<strip size='2147483647'> | ||
<card type='rows' /> | ||
</strip> | ||
</edge> | ||
</cards> | ||
</window> | ||
<window class='worksheet' maximized='true' name='Sheet 2'> | ||
<cards> | ||
<edge name='left'> | ||
<strip size='160'> | ||
<card type='pages' /> | ||
<card type='filters' /> | ||
<card type='marks' /> | ||
</strip> | ||
</edge> | ||
<edge name='top'> | ||
<strip size='2147483647'> | ||
<card type='columns' /> | ||
</strip> | ||
<strip size='2147483647'> | ||
<card type='rows' /> | ||
</strip> | ||
</edge> | ||
</cards> | ||
</window> | ||
</windows> | ||
</workbook> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import unittest | ||
import os.path | ||
|
||
from tableaudocumentapi import Datasource, Workbook | ||
|
||
TEST_ASSET_DIR = os.path.join( | ||
os.path.dirname(__file__), | ||
'assets' | ||
) | ||
EPHEMERAL_FIELD_FILE = os.path.join( | ||
TEST_ASSET_DIR, | ||
'ephemeral_field.twb' | ||
) | ||
|
||
|
||
class EphemeralFields(unittest.TestCase): | ||
def test_ephemeral_fields_do_not_cause_errors(self): | ||
wb = Workbook(EPHEMERAL_FIELD_FILE) | ||
self.assertIsNotNone(wb) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is because
zip
is a built-in so we should not use that as a name of the argument.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's coo' w. me