4 Replies Latest reply on Jun 26, 2017 1:49 AM by Matthew Naylor

    Tableau SDK Exception when loading in a datasource

    Vathsala Achar

      I have been using the Tableau SDK to load in an extract and read the table definition and I have managed this for the most part.


      extract_def = Extract(path=path_to_existing_extract)
      table = extract_def.openTable('Extract')
      table_def = table.getTableDefinition()
      col_count = table_def.getColumnCount()
      for i in range(col_count):
          print table_def.getColumnName(i), table_def.getColumnType(i)


      The above code works for for some extracts but then for other extracts I get a frustratingly vague exception as shown:


      Traceback (most recent call last):

        File "/home/vathsala/somewhere/aproject/edittde.py", line 5, in <module>

          extract_def = Extract(path=path_to_existing_extract)

        File "/home/vathsala/.virtualenvs/tabtest/local/lib/python2.7/site-packages/tableausdk/Extract.py", line 572, in __init__

          raise Exceptions.TableauException(ret, Exceptions.GetLastErrorMessage())

      tableausdk.Exceptions.TableauException: TableauException (303): Invalid column ordinal

      Does anyone know what this error means?


      Any help would be greatly appreciated.

        • 1. Re: Tableau SDK Exception when loading in a datasource
          Simon Runc

          Hi Ben Lower


          I'm no expert in the SDK side of Tableau, but exercised my Tableau Ambassador contacts to find who might be best placed to answer this one...and I was given you name!! (by Derrick Austin). Vathsala is is one of our developers working on the automation of our TDE creation


          Derrick did give me this possible reason, but Vathsala is only reading when she gets this error (and not inserting)?

          With ours, we have always created the extracts in Python instead of loading them from existing sources, but I have seen that error before.

          If I recall correctly, it happened to us when the "column number" of the column we were trying to insert didn't match the definition. (IE: trying to insert a 10th column when there were only 9 columns defined)


          If this is happening randomly from existing extracts, it might be a bug or something funny in your extracts that the extract API hasn't accounted for.


          Any help/advice is greatly appreciated.

          • 2. Re: Tableau SDK Exception when loading in a datasource
            Matthew Naylor



            Did you ever manage to find any resolution to this ?


            I'm hitting an identical problem in reading and existing extract, with no way of knowing what columns this refers to to try identity the cause.




            • 3. Re: Tableau SDK Exception when loading in a datasource
              Vathsala Achar

              Hi Matthew,


              As far as I know this is caused because new columns have been created through Tableau Desktop and these new columns sit in the Datasource definition but not in a way that the SDK can access it.


              What worked for us (at Atheon) was to create a TDE from scratch and publish that, then when new columns are created they sit in the workbook instead of the datasource. This separation then lets us use the SDK on the datasource for inserting new rows of data.


              I hope that helped.




              1 of 1 people found this helpful
              • 4. Re: Tableau SDK Exception when loading in a datasource
                Matthew Naylor

                Hi Vathsala,


                Cheers for the reply.  I did a lot of testing and rebuilding of the troublesome data source over the weekend, and eventually found this to be a seemingly corrupt or old extract.  Removing the Extract from the data source and re creating this afresh resolved out issues in the end .