GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Small bugfix in xfile opening by t8y8 · Pull Request #60 · tableau/document-api-python

Conversation

@t8y8

@t8y8 t8y8 commented Jul 23, 2016

Copy link
Copy Markdown
Contributor

Previously it was opening any valid xml file, despite supposedly checking for the right root tag.

Now we actually check for the root tag to see if it's in the whitelist.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@t8y8
We weren't truly checking for a workbook or datasource root tag, now …
c4c4b3b
…we are!
@graysonarts

graysonarts commented Jul 23, 2016

Copy link
Copy Markdown
Contributor

Would it be better to pass in the expected root element? It doesn't make sense that if you call Workbook("foo.tds") we wouldn't give a meaningful error. It would fail, but not with a meaningful error message.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t8y8

t8y8 commented Jul 23, 2016

Copy link
Copy Markdown
Contributor Author

The only way to know would be to force the user to explicitly say a Workbook should be a 'workbook', which feels redundant, or go back to checking the file extension -- which I can add, and it would actually let us optimize not opening every single file in the zip, and only open *.tds *.twb files

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t8y8
More robust approach for opening the right file
ea49e2f
(Not final approach, just want feedback)
(Also trying the github in web editor, so this was added blind)
@t8y8

t8y8 commented Jul 23, 2016

Copy link
Copy Markdown
Contributor Author

I think I've gotta scrap this approach and take a step back.

With the commit in its current state you can't rename a twbx to a tdsx and have it work, but you can load Workbook(TDSX_FILE) because all the xfile stuff doesn't have context for what root tag to look for. I can plumb that through, not sure how it feels yet.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t8y8

t8y8 commented Jul 23, 2016

Copy link
Copy Markdown
Contributor Author

@RussTheAerialist I think you should move open_xml into xfile and then we can ignore this bug for 0.2.

Then we can chat about a cleaner approach to making sure Workbook is actually getting a workbook file

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@graysonarts

graysonarts commented Jul 25, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I'm okay with that. My thought was that when you invoked it from Workbook or Datasource, you would just put in the root tag you expected. That way xfile remains generic and uncoupled to the concept of Workbook/Datasource, and workbook/datasource can specify the root tag to check (and only check if specified), same for file extension, I suppose.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t8y8

t8y8 commented Jul 25, 2016

Copy link
Copy Markdown
Contributor Author

Yeah, I like the idea of xml_open passing that argument, once you merge it I'll rebase and give it a go (I've got a long flight anyway)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t8y8 t8y8 mentioned this pull request Jul 26, 2016
New approach for checking we are loading the right file #62
Merged
@t8y8

t8y8 commented Jul 26, 2016

Copy link
Copy Markdown
Contributor Author

Replaced by #62

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t8y8 t8y8 closed this Jul 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@t8y8 @graysonarts
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.