-
Notifications
You must be signed in to change notification settings - Fork 436
Multi-Credential Support in TSC #276
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
10 commits
Select commit
Hold shift + click to select a range
ad79622
Adding multi-ds support to sample code
1d4e08f
Saving changes to multids branch
cbc7eb0
Merge branch 'multids' of https://github.com/tableau/server-client-py…
t8y8 d200bcb
checkpoint, both single and multi are working
t8y8 4eae250
2nd checkpoint, decided to not eb smart and just throw exceptions
t8y8 3a610bf
New checkpoint, add data sources and chunked requests -- untested
t8y8 9260e49
Update tests after lots of fiddling
t8y8 93ed3b3
Fixup test linting
t8y8 ec65b35
final touchup
t8y8 5b9046c
style fix
t8y8 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
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 |
---|---|---|
|
@@ -199,7 +199,14 @@ def _get_wb_preview_image(self, workbook_item): | |
|
||
# Publishes workbook. Chunking method if file over 64MB | ||
@api(version="2.0") | ||
def publish(self, workbook_item, file_path, mode, connection_credentials=None): | ||
@parameter_added_in(connections='2.8') | ||
def publish(self, workbook_item, file_path, mode, connection_credentials=None, connections=None): | ||
|
||
if connection_credentials is not None: | ||
import warnings | ||
warnings.warn("connection_credentials is being deprecated. Use connections instead", | ||
DeprecationWarning) | ||
|
||
if not os.path.isfile(file_path): | ||
error = "File path does not lead to an existing file." | ||
raise IOError(error) | ||
|
@@ -230,16 +237,21 @@ def publish(self, workbook_item, file_path, mode, connection_credentials=None): | |
logger.info('Publishing {0} to server with chunking method (workbook over 64MB)'.format(filename)) | ||
upload_session_id = Fileuploads.upload_chunks(self.parent_srv, file_path) | ||
url = "{0}&uploadSessionId={1}".format(url, upload_session_id) | ||
conn_creds = connection_credentials | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is conn_creds variable necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only because of line-length limits 🤷♂️ |
||
xml_request, content_type = RequestFactory.Workbook.publish_req_chunked(workbook_item, | ||
connection_credentials) | ||
connection_credentials=conn_creds, | ||
connections=connections) | ||
else: | ||
logger.info('Publishing {0} to server'.format(filename)) | ||
with open(file_path, 'rb') as f: | ||
file_contents = f.read() | ||
conn_creds = connection_credentials | ||
xml_request, content_type = RequestFactory.Workbook.publish_req(workbook_item, | ||
filename, | ||
file_contents, | ||
connection_credentials) | ||
connection_credentials=conn_creds, | ||
connections=connections) | ||
logger.debug('Request xml: {0} '.format(xml_request[:1000])) | ||
server_response = self.post_request(url, xml_request, content_type) | ||
new_workbook = WorkbookItem.from_response(server_response.content, self.parent_srv.namespace)[0] | ||
logger.info('Published {0} (ID: {1})'.format(filename, new_workbook.id)) | ||
|
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
Oops, something went wrong.
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.
I should allow this type through as well, missed it in first PR