Skip to content

Commit

Permalink
Add extra and renderedTemplates as keys to skip camelCasing (apache#4…
Browse files Browse the repository at this point in the history
…2206) (apache#42208)

* Add extra, conf and renderedTemplates as keys to skip camelCasing

* remove conf, check for extra in lists

(cherry picked from commit c29f8dd)

Co-authored-by: Brent Bovenzi <[email protected]>
  • Loading branch information
jscheffl and bbovenzi authored Sep 13, 2024
1 parent e36a64d commit 58af927
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions airflow/www/static/js/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ axios.interceptors.request.use((config) => {
return config;
});

// Do not camelCase xCom entry results
axios.interceptors.response.use((res: AxiosResponse) => {
const stopPaths = [];
// Do not camelCase rendered_fields or extra
const stopPaths = ["rendered_fields", "extra", "dataset_events.extra"];
// Do not camelCase xCom entry results
if (res.config.url?.includes("/xcomEntries/")) {
stopPaths.push("value");
}
Expand Down
6 changes: 2 additions & 4 deletions airflow/www/static/js/components/DatasetEventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ const DatasetEventCard = ({
const selectedUri = decodeURIComponent(searchParams.get("uri") || "");
const containerRef = useContainerRef();

const { fromRestApi, ...extra } = datasetEvent?.extra as Record<
string,
string
>;
const { from_rest_api: fromRestApi, ...extra } =
datasetEvent?.extra as Record<string, string>;

return (
<Box>
Expand Down
5 changes: 4 additions & 1 deletion airflow/www/static/js/dag/details/graph/DatasetNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ const DatasetNode = ({
}: NodeProps<CustomNodeProps>) => {
const containerRef = useContainerRef();

const { fromRestApi } = (datasetEvent?.extra || {}) as Record<string, string>;
const { from_rest_api: fromRestApi } = (datasetEvent?.extra || {}) as Record<
string,
string
>;

return (
<Popover>
Expand Down

0 comments on commit 58af927

Please sign in to comment.