Athena direct query dataset issue

Hi there,
I’m creating an Athena datasource and a direct query dataset in a restricted folder using python’s sdk Boto3.
When I Enter the UI to edit the dataset, it successfully retrieves a preview of the data. When I publish and create the visualisation it fails with permissions issues. The user is a contributor in the folder and an owner of both the data set and data source. When I do the exact same actions manually, the visualisations works. further, when I change the programatically created dataset from Direct Query to Spice it works good as well.
Any ideas?

Hello @Itamar , welcome to the Quicksight community!

Could you possibly share an anonymized view of the Boto3 script that you ran to provide the access? My hunch is that maybe there is just something small missing that needs to be changed.

Thanks!
Important: when I change the ImportMode to ‘SPICE’ the datasets are working as expected, the permission issue rises only on ‘DIRECT_QUERY’

Attaching the function that I am using to create the dataset:

def create_quicksight_athena_data_set(quicksight_client, aws_account_id, data_set_id, data_source_id, name, columns, database, table, folder_arn):

    try:
        response = quicksight_client.create_data_set(
            AwsAccountId=aws_account_id,
            DataSetId=data_set_id,
            Name=name,
            FolderArns=[folder_arn],
            PhysicalTableMap={
                data_set_id: {
                    'RelationalTable': {
                        'DataSourceArn': f'arn:aws:quicksight:eu-west-1:{aws_account_id}:datasource/{data_source_id}',
                        'Name': table,
                        'Catalog': 'AwsDataCatalog',
                        'Schema': database,
                        'InputColumns': columns
                    }
                }
            },
            ImportMode='DIRECT_QUERY',
        )
        logging.info(f'Data set id: {data_set_id} created successfully.')
    except Exception as e:
        logging.error(f'Error creating data set id: {data_set_id}: {e}')
1 Like

Updating that the issue was resolved when I changed the ID of the Dataset to be distinct from the ID of the Datasource. I believe that it is a bug sense I was able to deploy via the api two entities with the same ID that suppose to have distinct ID’s? Hope that it helps to improve Quicksight

1 Like

Hello @Itamar !

I am glad you were able to find an answer and thank you for sharing the solution to help the community.

I will tag this so that it is flagged up to the Quicksight team!