Skip to content

Commit

Permalink
Fix Worksheets for shared tables
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpzx committed Dec 3, 2024
1 parent 9ff55b4 commit cb9fbd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def validate_dataset_share_selector_input(data):


def list_shared_tables_by_env_dataset(context: Context, source, datasetUri: str, envUri: str):
return S3ShareService.list_shared_tables_by_env_dataset(datasetUri, envUri)
return S3ShareService.list_shared_tables_by_env_dataset(dataset_uri=datasetUri, uri=envUri)


@is_feature_enabled('modules.s3_datasets.features.aws_actions')
Expand Down
10 changes: 7 additions & 3 deletions frontend/src/modules/Worksheets/views/WorksheetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const WorksheetView = () => {
response.data.getSharedDatasetTables.map((t) => ({
...t,
value: t.tableUri,
label: t.restricted.GlueTableName
label: t.GlueTableName
}))
);
} else if (!response.errors) {
Expand Down Expand Up @@ -379,7 +379,11 @@ const WorksheetView = () => {
dispatch({ type: SET_ERROR, error: e.message })
);
setSqlBody(
`SELECT * FROM "${selectedDatabase.label}"."${event.target.value.restricted.GlueTableName}" limit 10;`
`SELECT * FROM "${selectedDatabase.label}"."${
event.target.value.restricted
? event.target.value.restricted.GlueTableName
: event.target.value.GlueTableName
}" limit 10;`
);
}

Expand Down Expand Up @@ -512,7 +516,7 @@ const WorksheetView = () => {
{tableOptions.length > 0 ? (
tableOptions.map((table) => (
<MenuItem key={table.tableUri} value={table}>
{table.restricted.GlueTableName}
{table.label}
</MenuItem>
))
) : (
Expand Down

0 comments on commit cb9fbd0

Please sign in to comment.