document-api-python icon indicating copy to clipboard operation
document-api-python copied to clipboard

xfile - Issue opening a .twbx containing custom geocoding

Open itsmarco opened this issue 7 years ago • 4 comments

Hello,

I was trying to open a 9.3 workbook with custom geocoding attached. find_file_in_zip() evaluates .tds files as well as .twb files when opening a .twbx. A .twbx can contain .tds files if it contains custom geocoding.

I'm not quite sure what determines the order of the filenames in candidate_files, but if a .tds happens to end up before a .tdw in the list, the .tds will be evaluated first as a workbook. This raises the TableauInvalidFileException: filename is not a valid 'workbook' file.

I cannot share the workbook (it contains private data), I can share some screenshots of its contents: image

image

A suggested fix for this would be to only check for .twb's if the file is a .twb/.twbx.

Cheers, Marco

itsmarco avatar Mar 24 '17 11:03 itsmarco

Forgot to add: I've tried this with both the development as the master branch version of xfile.py

itsmarco avatar Mar 24 '17 11:03 itsmarco

Darn, I was really hoping to keep that layer clear of too much reliance on the input file extension... but we may have to go back to doing something like that to avoid these types of bugs.

Thanks for reporting!

t8y8 avatar Mar 27 '17 06:03 t8y8

If I'm not mistaken, the .twb or .tds file in a .twbx or .tdsx will always be in the root of the archive. If I'm also not mistaken, all other file are always in a folder. So you could possibly just look at the files in the root to find the file you're looking for. Again not 100% sure this will work, just a suggestion :)

itsmarco avatar Mar 27 '17 07:03 itsmarco

@itsmarco excellent suggestion, I'll see what I can whip up!

t8y8 avatar Mar 27 '17 18:03 t8y8