Repository navigation
UI: Fix Dag code highlighting for triple-quoted and escaped-brace f-strings - #68026
Merged
Merged
Conversation
Revanth14
requested review from
bbovenzi,
choo121600,
guan404ming,
pierrejeambrun,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
June 4, 2026 16:41
1 of 2 tasks
Contributor
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
github-actions Bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
Jun 4, 2026
(cherry picked from commit dc27827) Co-authored-by: Revanth <revanthcse1@gmail.com>
aws-airflow-bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
Jun 4, 2026
(cherry picked from commit dc27827) Co-authored-by: Revanth <revanthcse1@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #67986
Supersedes #67997 by fixing the triple-quoted f-string tokenizer state, not only escaped braces in existing f-string states.
Fix Dag code syntax highlighting for triple-quoted Python f-strings that contain escaped braces, such as Jinja templates written as
{{{{ ds }}}}.Root cause: Monaco's bundled Python tokenizer routes triple-quoted f-strings through single-line f-string states and mishandles escaped braces, causing highlighting to leak past the closing triple quote.
This change registers Python with a patched Monarch grammar for the Airflow UI's Monaco editor and adds regression coverage using Monaco's real tokenizer.
Before:

After:

Tests:
pnpm test src/components/MonacoEditor/pythonFStrings.test.tspnpm exec eslint src/components/MonacoEditor/pythonFStrings.ts src/components/MonacoEditor/pythonFStrings.test.ts src/components/MonacoEditor/configureMonaco.ts src/vite-env.d.tspnpm exec prettier --check src/components/MonacoEditor/pythonFStrings.ts src/components/MonacoEditor/pythonFStrings.test.ts src/components/MonacoEditor/configureMonaco.ts src/vite-env.d.tspnpm exec tsc --p tsconfig.app.json --noEmitWas generative AI tooling used to co-author this PR?