codeant-ai-for-open-source[bot] commented on code in PR #45588:
URL: https://github.com/apache/superset/pull/45588#discussion_r4341749944
##########
.github/workflows/update-country-maps.yml:
##########
@@ -0,0 +1,146 @@
+name: Update Country Maps
+
+# Regenerates plugins/plugin-chart-country-map's GeoJSON files, countries.ts
+# and docs/data/countries.json from upstream Natural Earth + community geo
+# data, by running the same notebook `npm run update-maps` runs locally.
+#
+# This is workflow_dispatch-only, not scheduled: unlike a translation-string
+# catch-up, a border/region change here is the kind of thing that needs an
+# actual human look at the rendered maps before merging, not an unattended
+# auto-merge. Several sources the notebook reads from are community repos
+# tracked at a floating `main` ref rather than a pinned commit, and one is a
+# live WHO ArcGIS query, so a run can legitimately pick up an unreviewed
+# upstream change. A maintainer triggers this when they know upstream data
+# moved (e.g. a new Natural Earth release) and reviews the diff before
+# merging, the same way bump-python-package.yml's dispatch-only bot works.
+on:
+ workflow_dispatch: {}
+
+permissions:
+ contents: read
+
+jobs:
+ update-country-maps:
+ runs-on: ubuntu-26.04
+ permissions:
+ contents: write
+ pull-requests: write
+ steps:
+ - name: "Checkout master"
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #
v7.0.1
+ with:
+ ref: master
+ persist-credentials: true
+
+ - name: Setup Python
+ uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 #
v7.0.0
+ with:
+ python-version: "3.11"
+
+ - name: Install notebook dependencies
+ run: |
+ pip install jupyter nbconvert ipykernel geopandas shapely matplotlib
requests
+
+ - name: Force speed_run (skip interactive preview rendering)
+ working-directory:
superset-frontend/plugins/plugin-chart-country-map/scripts
+ run: |
+ python3 - <<'PYEOF'
+ import json
+
+ path = "Country Map GeoJSON Generator.ipynb"
+ with open(path, encoding="utf-8") as f:
+ nb = json.load(f)
+
+ for cell in nb["cells"]:
+ if cell["cell_type"] != "code":
+ continue
+ if "".join(cell["source"]).strip().startswith("speed_run =
False"):
+ cell["source"] = [
+ "speed_run = True\n",
+ "# forced True for unattended CI regeneration; not
committed back\n",
+ ]
+ break
+ else:
+ raise SystemExit("Could not find the speed_run cell to patch")
+
+ with open(".ci-run.ipynb", "w", encoding="utf-8") as f:
+ json.dump(nb, f)
+ PYEOF
+
+ - name: Run notebook
+ working-directory:
superset-frontend/plugins/plugin-chart-country-map/scripts
+ run: |
+ jupyter nbconvert --to notebook --execute --inplace --allow-errors \
+ --ExecutePreprocessor.timeout=1200 .ci-run.ipynb
+
+ - name: Check for cell errors and record a summary
+ id: notebook
+ working-directory:
superset-frontend/plugins/plugin-chart-country-map/scripts
+ run: |
+ python3 - <<'PYEOF' >> "$GITHUB_OUTPUT"
+ import json
+
+ with open(".ci-run.ipynb", encoding="utf-8") as f:
+ nb = json.load(f)
+
+ errors = []
+ for i, cell in enumerate(nb["cells"]):
+ for output in cell.get("outputs", []):
+ if output.get("output_type") == "error":
+ errors.append(f"cell {i}: {output.get('ename')}:
{output.get('evalue')}")
+
+ if errors:
+ print("had_errors=true")
+ summary = "\\n".join(f"- {e}" for e in errors[:20])
+ else:
+ print("had_errors=false")
+ summary = ""
+
+ with open("notebook-errors.txt", "w", encoding="utf-8") as f:
+ f.write(summary)
+ PYEOF
+ rm -f .ci-run.ipynb
+
+ - name: Check for drift
+ id: diff
+ run: |
+
PATHS="superset-frontend/plugins/plugin-chart-country-map/src/countries
superset-frontend/plugins/plugin-chart-country-map/src/countries.ts
docs/data/countries.json"
+ if git diff --quiet -- $PATHS; then
+ echo "has_changes=false" >> "$GITHUB_OUTPUT"
+ else
+ echo "has_changes=true" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: Open or update sync PR
+ if: steps.diff.outputs.has_changes == 'true'
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ BRANCH: chore/update-country-maps-automated
+ HAD_ERRORS: ${{ steps.notebook.outputs.had_errors }}
+ run: |
+ git config user.name "GitHub Action"
+ git config user.email "[email protected]"
+ git checkout -b "$BRANCH"
+ git add
superset-frontend/plugins/plugin-chart-country-map/src/countries \
+
superset-frontend/plugins/plugin-chart-country-map/src/countries.ts \
+ docs/data/countries.json
+ git commit -m "chore(country-map): regenerate GeoJSON from upstream
sources" \
+ -m "Automated run of the Country Map GeoJSON Generator notebook
(npm run update-maps). Review the rendered diffs before merging - some sources
are tracked at a floating ref rather than a pinned commit."
+ git push --force origin "$BRANCH"
Review Comment:
**Suggestion:** Concurrent manual runs force-push the same branch without
serialization; a slower run can replace newer generated data and leave the PR
with stale results.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Rarely` ยท ๐ท๏ธ `Race condition`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d231f7624178499ca62e9eed09293d67&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d231f7624178499ca62e9eed09293d67&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** .github/workflows/update-country-maps.yml
**Line:** 129:129
**Comment:**
*Race Condition: Concurrent manual runs force-push the same branch
without serialization; a slower run can replace newer generated data and leave
the PR with stale results.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45588&comment_hash=58a47412ef8a169099b1d30b17965dae9055710f5e7a2a3d4da831a35a96a5ac&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45588&comment_hash=58a47412ef8a169099b1d30b17965dae9055710f5e7a2a3d4da831a35a96a5ac&reaction=dislike'>๐</a>
##########
.github/workflows/update-country-maps.yml:
##########
@@ -0,0 +1,146 @@
+name: Update Country Maps
+
+# Regenerates plugins/plugin-chart-country-map's GeoJSON files, countries.ts
+# and docs/data/countries.json from upstream Natural Earth + community geo
+# data, by running the same notebook `npm run update-maps` runs locally.
+#
+# This is workflow_dispatch-only, not scheduled: unlike a translation-string
+# catch-up, a border/region change here is the kind of thing that needs an
+# actual human look at the rendered maps before merging, not an unattended
+# auto-merge. Several sources the notebook reads from are community repos
+# tracked at a floating `main` ref rather than a pinned commit, and one is a
+# live WHO ArcGIS query, so a run can legitimately pick up an unreviewed
+# upstream change. A maintainer triggers this when they know upstream data
+# moved (e.g. a new Natural Earth release) and reviews the diff before
+# merging, the same way bump-python-package.yml's dispatch-only bot works.
+on:
+ workflow_dispatch: {}
+
+permissions:
+ contents: read
+
+jobs:
+ update-country-maps:
+ runs-on: ubuntu-26.04
+ permissions:
+ contents: write
+ pull-requests: write
+ steps:
+ - name: "Checkout master"
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #
v7.0.1
+ with:
+ ref: master
+ persist-credentials: true
+
+ - name: Setup Python
+ uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 #
v7.0.0
+ with:
+ python-version: "3.11"
+
+ - name: Install notebook dependencies
+ run: |
+ pip install jupyter nbconvert ipykernel geopandas shapely matplotlib
requests
+
+ - name: Force speed_run (skip interactive preview rendering)
+ working-directory:
superset-frontend/plugins/plugin-chart-country-map/scripts
+ run: |
+ python3 - <<'PYEOF'
+ import json
+
+ path = "Country Map GeoJSON Generator.ipynb"
+ with open(path, encoding="utf-8") as f:
+ nb = json.load(f)
+
+ for cell in nb["cells"]:
+ if cell["cell_type"] != "code":
+ continue
+ if "".join(cell["source"]).strip().startswith("speed_run =
False"):
+ cell["source"] = [
+ "speed_run = True\n",
+ "# forced True for unattended CI regeneration; not
committed back\n",
+ ]
+ break
+ else:
+ raise SystemExit("Could not find the speed_run cell to patch")
+
+ with open(".ci-run.ipynb", "w", encoding="utf-8") as f:
+ json.dump(nb, f)
+ PYEOF
+
+ - name: Run notebook
+ working-directory:
superset-frontend/plugins/plugin-chart-country-map/scripts
+ run: |
+ jupyter nbconvert --to notebook --execute --inplace --allow-errors \
+ --ExecutePreprocessor.timeout=1200 .ci-run.ipynb
+
+ - name: Check for cell errors and record a summary
+ id: notebook
+ working-directory:
superset-frontend/plugins/plugin-chart-country-map/scripts
+ run: |
+ python3 - <<'PYEOF' >> "$GITHUB_OUTPUT"
+ import json
+
+ with open(".ci-run.ipynb", encoding="utf-8") as f:
+ nb = json.load(f)
+
+ errors = []
+ for i, cell in enumerate(nb["cells"]):
+ for output in cell.get("outputs", []):
+ if output.get("output_type") == "error":
+ errors.append(f"cell {i}: {output.get('ename')}:
{output.get('evalue')}")
+
+ if errors:
+ print("had_errors=true")
+ summary = "\\n".join(f"- {e}" for e in errors[:20])
+ else:
+ print("had_errors=false")
+ summary = ""
+
+ with open("notebook-errors.txt", "w", encoding="utf-8") as f:
+ f.write(summary)
+ PYEOF
+ rm -f .ci-run.ipynb
+
+ - name: Check for drift
+ id: diff
+ run: |
+
PATHS="superset-frontend/plugins/plugin-chart-country-map/src/countries
superset-frontend/plugins/plugin-chart-country-map/src/countries.ts
docs/data/countries.json"
+ if git diff --quiet -- $PATHS; then
+ echo "has_changes=false" >> "$GITHUB_OUTPUT"
+ else
+ echo "has_changes=true" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: Open or update sync PR
+ if: steps.diff.outputs.has_changes == 'true'
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Review Comment:
**Suggestion:** PR creation uses `GITHUB_TOKEN`, which suppresses resulting
GitHub Actions runs, so the generated PR receives no automatic pull-request CI
checks.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Often` ยท ๐ท๏ธ `Api mismatch`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=857d0c4219974e1690776374b61089a9&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=857d0c4219974e1690776374b61089a9&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** .github/workflows/update-country-maps.yml
**Line:** 117:117
**Comment:**
*Api Mismatch: PR creation uses `GITHUB_TOKEN`, which suppresses
resulting GitHub Actions runs, so the generated PR receives no automatic
pull-request CI checks.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45588&comment_hash=6f0051a186b413999c6eddd386465f3b1f00ec15a10088eb205b031fa49b95d6&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45588&comment_hash=6f0051a186b413999c6eddd386465f3b1f00ec15a10088eb205b031fa49b95d6&reaction=dislike'>๐</a>
##########
.github/workflows/update-country-maps.yml:
##########
@@ -0,0 +1,146 @@
+name: Update Country Maps
+
+# Regenerates plugins/plugin-chart-country-map's GeoJSON files, countries.ts
+# and docs/data/countries.json from upstream Natural Earth + community geo
+# data, by running the same notebook `npm run update-maps` runs locally.
+#
+# This is workflow_dispatch-only, not scheduled: unlike a translation-string
+# catch-up, a border/region change here is the kind of thing that needs an
+# actual human look at the rendered maps before merging, not an unattended
+# auto-merge. Several sources the notebook reads from are community repos
+# tracked at a floating `main` ref rather than a pinned commit, and one is a
+# live WHO ArcGIS query, so a run can legitimately pick up an unreviewed
+# upstream change. A maintainer triggers this when they know upstream data
+# moved (e.g. a new Natural Earth release) and reviews the diff before
+# merging, the same way bump-python-package.yml's dispatch-only bot works.
+on:
+ workflow_dispatch: {}
+
+permissions:
+ contents: read
+
+jobs:
+ update-country-maps:
+ runs-on: ubuntu-26.04
+ permissions:
+ contents: write
+ pull-requests: write
+ steps:
+ - name: "Checkout master"
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #
v7.0.1
+ with:
+ ref: master
+ persist-credentials: true
+
+ - name: Setup Python
+ uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 #
v7.0.0
+ with:
+ python-version: "3.11"
+
+ - name: Install notebook dependencies
+ run: |
+ pip install jupyter nbconvert ipykernel geopandas shapely matplotlib
requests
+
+ - name: Force speed_run (skip interactive preview rendering)
+ working-directory:
superset-frontend/plugins/plugin-chart-country-map/scripts
+ run: |
+ python3 - <<'PYEOF'
+ import json
+
+ path = "Country Map GeoJSON Generator.ipynb"
+ with open(path, encoding="utf-8") as f:
+ nb = json.load(f)
+
+ for cell in nb["cells"]:
+ if cell["cell_type"] != "code":
+ continue
+ if "".join(cell["source"]).strip().startswith("speed_run =
False"):
+ cell["source"] = [
+ "speed_run = True\n",
+ "# forced True for unattended CI regeneration; not
committed back\n",
+ ]
+ break
+ else:
+ raise SystemExit("Could not find the speed_run cell to patch")
+
+ with open(".ci-run.ipynb", "w", encoding="utf-8") as f:
+ json.dump(nb, f)
+ PYEOF
+
+ - name: Run notebook
+ working-directory:
superset-frontend/plugins/plugin-chart-country-map/scripts
+ run: |
+ jupyter nbconvert --to notebook --execute --inplace --allow-errors \
+ --ExecutePreprocessor.timeout=1200 .ci-run.ipynb
+
+ - name: Check for cell errors and record a summary
+ id: notebook
+ working-directory:
superset-frontend/plugins/plugin-chart-country-map/scripts
+ run: |
+ python3 - <<'PYEOF' >> "$GITHUB_OUTPUT"
+ import json
+
+ with open(".ci-run.ipynb", encoding="utf-8") as f:
+ nb = json.load(f)
+
+ errors = []
+ for i, cell in enumerate(nb["cells"]):
+ for output in cell.get("outputs", []):
+ if output.get("output_type") == "error":
+ errors.append(f"cell {i}: {output.get('ename')}:
{output.get('evalue')}")
+
+ if errors:
+ print("had_errors=true")
+ summary = "\\n".join(f"- {e}" for e in errors[:20])
+ else:
+ print("had_errors=false")
+ summary = ""
+
+ with open("notebook-errors.txt", "w", encoding="utf-8") as f:
+ f.write(summary)
+ PYEOF
+ rm -f .ci-run.ipynb
+
+ - name: Check for drift
+ id: diff
+ run: |
+
PATHS="superset-frontend/plugins/plugin-chart-country-map/src/countries
superset-frontend/plugins/plugin-chart-country-map/src/countries.ts
docs/data/countries.json"
+ if git diff --quiet -- $PATHS; then
+ echo "has_changes=false" >> "$GITHUB_OUTPUT"
+ else
+ echo "has_changes=true" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: Open or update sync PR
+ if: steps.diff.outputs.has_changes == 'true'
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ BRANCH: chore/update-country-maps-automated
+ HAD_ERRORS: ${{ steps.notebook.outputs.had_errors }}
+ run: |
+ git config user.name "GitHub Action"
+ git config user.email "[email protected]"
+ git checkout -b "$BRANCH"
+ git add
superset-frontend/plugins/plugin-chart-country-map/src/countries \
+
superset-frontend/plugins/plugin-chart-country-map/src/countries.ts \
+ docs/data/countries.json
+ git commit -m "chore(country-map): regenerate GeoJSON from upstream
sources" \
+ -m "Automated run of the Country Map GeoJSON Generator notebook
(npm run update-maps). Review the rendered diffs before merging - some sources
are tracked at a floating ref rather than a pinned commit."
+ git push --force origin "$BRANCH"
+
+ BODY="Automated run of \`npm run update-maps\` against current
\`master\`. **Please review the rendered map diffs before merging** - this
pulls from several community geo sources (some on a floating \`main\` ref, not
a pinned commit) and a live WHO ArcGIS query, so an upstream change here hasn't
had human eyes on it yet."
+ if [ "$HAD_ERRORS" = "true" ]; then
+ BODY="$BODY
+
+ โ ๏ธ The notebook run hit cell errors (ran with --allow-errors, so it
continued past them - affected countries' data may be stale rather than
updated):
+ $(cat
superset-frontend/plugins/plugin-chart-country-map/scripts/notebook-errors.txt)"
+ fi
+
+ if gh pr list --repo "$GITHUB_REPOSITORY" --head "$BRANCH" --state
open --json number --jq 'length > 0' | grep -q true; then
+ echo "PR already open for $BRANCH; branch push above updated it."
Review Comment:
**Suggestion:** When an existing PR is updated, this branch only prints a
message; it never refreshes the body, so later notebook errors may go unwarned.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Rarely` ยท ๐ท๏ธ `Incomplete
implementation`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=1daa7fa1d4c24441a13f3478b1edc7d7&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=1daa7fa1d4c24441a13f3478b1edc7d7&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** .github/workflows/update-country-maps.yml
**Line:** 140:140
**Comment:**
*Incomplete Implementation: When an existing PR is updated, this branch
only prints a message; it never refreshes the body, so later notebook errors
may go unwarned.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45588&comment_hash=55efe2451bcbdadbf4fd99f7162565ca5a1116ddf822d99dfb42d679b28a83e6&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45588&comment_hash=55efe2451bcbdadbf4fd99f7162565ca5a1116ddf822d99dfb42d679b28a83e6&reaction=dislike'>๐</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]