Skip to content
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

Doesn't work with more than 2 tables? #72

Open
chwalters opened this issue Aug 1, 2022 · 11 comments
Open

Doesn't work with more than 2 tables? #72

chwalters opened this issue Aug 1, 2022 · 11 comments

Comments

@chwalters
Copy link

The example works at first but then I tried to add a third table, and I get an error as below. Does anybody know if it is possible to upload a hyper file with more than 2 tables without a TDS?

`tableauserverclient.server.endpoint.exceptions.ServerResponseError:

400011: Bad Request
	There was a problem publishing the file 'Test.hyper'.`
@jonas-eckhardt
Copy link
Contributor

@chwalters which example are you referring to?

I assume it's the publish multi-table one (https://github.com/tableau/hyper-api-samples/tree/main/Community-Supported/publish-multi-table-hyper)?

Did you properly set up constraints such that Tableau Server (2021.4+) can infer the data model from the hyper file? This is happening in line 63-65 in the example (

connection.execute_command(f'ALTER TABLE {customer_table.table_name} ADD ASSUMED PRIMARY KEY ("Customer ID")')
)

Cheers
Jonas

@chwalters
Copy link
Author

Sorry yes, it is the multi-table hyper example, sorry. Below is the way I added the 3rd table and constraints. Sorry about the formatting but it does all 'work' except the uploading (I can load the resulting .hyper in desktop, for example)

customer_emails_table = TableDefinition( table_name="CustomerEmails", columns=[ TableDefinition.Column(name="Email Address", type=SqlType.varchar(1024), nullability=NOT_NULLABLE), TableDefinition.Column(name="Customer ID", type=SqlType.text(), nullability=NOT_NULLABLE) ] )

connection.catalog.create_table(table_definition=customer_emails_table)

alter_statement = f'''ALTER TABLE {customer_emails_table.table_name} ADD ASSUMED FOREIGN KEY ("Customer ID") REFERENCES {customer_table.table_name} ( "Customer ID" )''' connection.execute_command(alter_statement)

email_data_to_insert = [ ["DK-13375", "[email protected]"], ["DK-13375", "[email protected]"], ["EB-13705", "[email protected]"] ]

with Inserter(connection, customer_emails_table) as inserter: inserter.add_rows(rows=email_data_to_insert) inserter.execute()

@jonas-eckhardt
Copy link
Contributor

Hmm.. we need to have a closer look at this. Can you please provide a complete & self-contained repo?

@chwalters
Copy link
Author

Sure thing. I forked the repo and made the changes. I tested with my own config.json which I can't share for obvious reasons... chwalters@717bb0c

@jonas-eckhardt
Copy link
Contributor

@chwalters are you experiencing this issue with Tableau Cloud (formally known as Tableau Online) or an on-prem server? If on-prem, what version?

I'll go ahead and report a defect for this for further investigation. We'll follow up with you in here.

@chwalters
Copy link
Author

I'm using Tableau Cloud/Online, this is what the server reports:

{ "serverInfo": { "productVersion": { "value": "2022.2.0", "build": "20222.22.0722.0032" }, "prepConductorVersion": "2022.2.1", "restApiVersion": "3.16", "platform": "Linux", "serverSettings": { "oAuthEnabled": true, "sheetImageMaxAgeFloor": 1, "sheetImageMaxAgeCeiling": 240, "offlineInteractionSupportedPhase": 2 } } }

I'm also using 0.19 of Tableau Server Client lib in my local dev env. I appreciate any help or mitigation / alternative strategies for how best to upload multi-table Hyper files. Thank you for reporting/investigating!

@chwalters
Copy link
Author

I guess I shouldn't have any expectations of a quick resolution but just wondering if anybody has been able to look into this?

@vogelsgesang
Copy link
Contributor

We are still investigating this issue. Unfortunately, I am not aware of any progress we could share at this point

@gleb-kalinin
Copy link

Hello everyone,
I'm stuck in this issue as well.

It probably might be something with setting Primary and Foreign keys:
connection.execute_command( f'ALTER TABLE {customer_table.table_name} ADD ASSUMED PRIMARY KEY ("Customer ID")') connection.execute_command(f'''ALTER TABLE {orders_table.table_name} ADD ASSUMED FOREIGN KEY ("Customer ID") REFERENCES {customer_table.table_name} ( "Customer ID" )''')

As was mentioned above it works for 2 tables, but do you have any ideas how to extend it to 3 or more tables?

@chwalters
Copy link
Author

Hello everyone, I'm stuck in this issue as well.

It probably might be something with setting Primary and Foreign keys: connection.execute_command( f'ALTER TABLE {customer_table.table_name} ADD ASSUMED PRIMARY KEY ("Customer ID")') connection.execute_command(f'''ALTER TABLE {orders_table.table_name} ADD ASSUMED FOREIGN KEY ("Customer ID") REFERENCES {customer_table.table_name} ( "Customer ID" )''')

As was mentioned above it works for 2 tables, but do you have any ideas how to extend it to 3 or more tables?

I think it is still being looked into by somebody at Tableau (hopefully! :-))

@vogelsgesang
Copy link
Contributor

Yes, internally this is tracked as "Defect 1442219: Publishing a multi-table extract with three tables results in 400011: Bad Request" in our bug tracker (in case you have some account executive/representative at Tableau you might want to reach out to, use that reference number... will make it easier to tie things together on our own end...)

Unfortunately, the Hyper Update Rest API is owned by a sibling team of the team behind HyperAPI (which I am part of), and the HyperAPI team itself has only very limited possibilities to debug/fix this by themselves...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants