Skip to content

Commit

Permalink
encodeURIComponent namespace and name in GET (column)lineage requests (
Browse files Browse the repository at this point in the history
…#2984)

* encodeURIComponent namespace and name in GET lineage request

Signed-off-by: Maarten Hubrechts <maarten.hubrechts@hotmail.com>

* Use same coding style for encoding as in jobs and datasets requests

Signed-off-by: Maarten Hubrechts <maarten.hubrechts@hotmail.com>

---------

Signed-off-by: Maarten Hubrechts <maarten.hubrechts@hotmail.com>
  • Loading branch information
MaartenHubrechts authored Nov 22, 2024
1 parent 41d9d3d commit 7fb3d5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions web/src/store/requests/columnlineage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export const getColumnLineage = async (
name: string,
depth: number
) => {
const nodeId = generateNodeId(nodeType, namespace, name)
// Node ID cannot be URL encoded
const encodedNamespace = encodeURIComponent(namespace)
const encodedName = encodeURIComponent(name)
const nodeId = generateNodeId(nodeType, encodedNamespace, encodedName)
const url = `${API_URL}/column-lineage?nodeId=${nodeId}&depth=${depth}&withDownstream=true`
return genericFetchWrapper(url, { method: 'GET' }, 'fetchColumnLineage')
}
5 changes: 3 additions & 2 deletions web/src/store/requests/lineage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export const getLineage = async (
name: string,
depth: number
) => {
const nodeId = generateNodeId(nodeType, namespace, name)
// Node ID cannot be URL encoded
const encodedNamespace = encodeURIComponent(namespace)
const encodedName = encodeURIComponent(name)
const nodeId = generateNodeId(nodeType, encodedNamespace, encodedName)
const url = `${API_URL}/lineage?nodeId=${nodeId}&depth=${depth}`
return genericFetchWrapper(url, { method: 'GET' }, 'fetchLineage')
}

0 comments on commit 7fb3d5e

Please sign in to comment.