Skip to content

Commit

Permalink
fix: Unable to sync columns when database or dataset name contains + (
Browse files Browse the repository at this point in the history
  • Loading branch information
mapledan committed Oct 3, 2023
1 parent e3244e9 commit dbe0838
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,7 @@ class DatasourceEditor extends React.PureComponent {
database_name:
datasource.database.database_name || datasource.database.name,
schema_name: datasource.schema,
table_name: datasource.table_name
? encodeURIComponent(datasource.table_name)
: datasource.table_name,
table_name: datasource.table_name,
normalize_columns: datasource.normalize_columns,
always_filter_main_dttm: datasource.always_filter_main_dttm,
};
Expand All @@ -774,7 +772,7 @@ class DatasourceEditor extends React.PureComponent {
params[key] = null;
}
});
const endpoint = `/datasource/external_metadata_by_name/?q=${rison.encode(
const endpoint = `/datasource/external_metadata_by_name/?q=${rison.encode_uri(
params,
)}`;
this.setState({ metadataLoading: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('DatasourceEditor', () => {
setTimeout(() => {
expect(fetchMock.calls(DATASOURCE_ENDPOINT)).toHaveLength(1);
expect(fetchMock.calls(DATASOURCE_ENDPOINT)[0][0]).toContain(
'Vehicle%20Sales%20%2B%27',
'Vehicle+Sales%20%2B',
);
fetchMock.reset();
done();
Expand Down

0 comments on commit dbe0838

Please sign in to comment.