Skip to content

fix: handle sqlglot OptimizeError for DuckDB unnest with JSON access #12019

fix: handle sqlglot OptimizeError for DuckDB unnest with JSON access

fix: handle sqlglot OptimizeError for DuckDB unnest with JSON access #12019

Workflow file for this run

name: marimo bot
on:
issue_comment:
types: [created]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
env:
TURBO_TEAM: marimo
jobs:
# Various jobs that can be triggered by comments
create-test-release:
if: >
(
github.event.issue.author_association == 'OWNER' ||
github.event.issue.author_association == 'COLLABORATOR' ||
github.event.issue.author_association == 'MEMBER' ||
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.comment.author_association == 'MEMBER'
) &&
github.event.issue.pull_request &&
contains(github.event.comment.body, '/marimo create-test-release')
name: πŸ“€ Publish test release
runs-on: ubuntu-latest
defaults:
run:
shell: bash
outputs:
marimo_version: ${{ steps.get_version.outputs.marimo_version }}
comment_id: ${{ steps.comment.outputs.result }}
steps:
- name: πŸ“ Get PR Info
id: pr
env:
PR_NUMBER: ${{ github.event.issue.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
COMMENT_AT: ${{ github.event.comment.created_at }}
run: |
pr="$(gh api /repos/${GH_REPO}/pulls/${PR_NUMBER})"
head_sha="$(echo "$pr" | jq -r .head.sha)"
pushed_at="$(echo "$pr" | jq -r .head.repo.pushed_at)"
# NB mitigate potential race condition.
if [[ $(date -d "$pushed_at" +%s) -gt $(date -d "$COMMENT_AT" +%s) ]]; then
echo "Updating is not allowed because the PR was pushed to (at $pushed_at) after the triggering comment was issued (at $COMMENT_AT)"
exit 1
fi
echo "head_sha=$head_sha" >> $GITHUB_OUTPUT
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ steps.pr.outputs.head_sha }}
- name: πŸ“ Initial Comment on PR
uses: actions/github-script@v7
id: comment
with:
script: |
const comment = await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: 'πŸš€ Starting test release process...'
});
console.log(`Comment created with ID: ${comment.data.id}`);
return comment.data.id;
- name: πŸ“¦ Build frontend
uses: ./.github/actions/build-frontend
with:
turbo-token: ${{ secrets.TURBO_TOKEN }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Adapt pyproject.toml to build marimo-base
run: uv run ./scripts/modify_pyproject_for_marimo_base.py
# patch pyproject.toml version to be of the form
# X.Y.Z-dev9{4random digits}
# This must be a valid semver version from
# https://packaging.python.org/en/latest/discussions/versioning/
- name: πŸ”¨ Patch version number
id: get_version
run: |
# Get the version number
current_version=`uv version --short`
# Generate a random 4-digit number
random_digits=`shuf -i 1000-9999 -n 1`
# Form the new version with the random digits
MARIMO_VERSION="${current_version}-dev9${random_digits}"
# Set the version in the environment for later steps
echo "MARIMO_VERSION=$MARIMO_VERSION" >> $GITHUB_ENV
echo "marimo_version=$MARIMO_VERSION" >> $GITHUB_OUTPUT
uv version "$MARIMO_VERSION"
env:
NO_COLOR: 1
- name: πŸ“¦ Build marimo
run: uv build
- name: πŸ“¦ Validate wheel under 2mb
run: ./scripts/validate_base_wheel_size.sh
- name: πŸ“€ Upload to TestPyPI
env:
HATCH_INDEX_USER: ${{ secrets.TEST_PYPI_USER }}
HATCH_INDEX_AUTH: ${{ secrets.TEST_PYPI_MARIMO_BASE_PASSWORD }}
run: uvx hatch publish --repo test
- name: πŸ“¦ Update package.json version from CLI
working-directory: frontend
run: |
echo "Updating package.json version to ${{ env.MARIMO_VERSION }}"
npm version ${{ env.MARIMO_VERSION }} --no-git-tag-version
- name: πŸ“¦ Upload frontend artifact for npm publish
uses: actions/upload-artifact@v6
with:
name: frontend-test-branch
path: frontend/
retention-days: 1
publish_wasm_test:
name: πŸ“€ Publish @marimo-team/frontend to npm
needs: create-test-release
uses: ./.github/workflows/publish-npm.yml
with:
package-artifact-name: frontend-test-branch
working-directory: '.'
npm-tag: 'dev'
permissions:
id-token: write # Required for OIDC
contents: read
update_pr_comment:
name: πŸ“ Update PR Comment
needs: [create-test-release, publish_wasm_test]
runs-on: ubuntu-latest
if: always()
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: πŸ“ Update PR Comment on Success
if: needs.publish_wasm_test.result == 'success'
uses: actions/github-script@v7
continue-on-error: true
env:
MARIMO_VERSION: ${{ needs.create-test-release.outputs.marimo_version }}
COMMENT_ID: ${{ needs.create-test-release.outputs.comment_id }}
with:
script: |
try {
const commentId = parseInt(process.env.COMMENT_ID, 10);
const marimoVersion = process.env.MARIMO_VERSION || 'unknown';
console.log(`Updating comment with ID: ${commentId}`);
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: commentId,
body: `πŸš€ Test release published. You may be able to view the changes at https://marimo.app?v=${encodeURIComponent(marimoVersion)}`
});
} catch (err) {
console.error(err);
}
- name: πŸ“ Update PR Comment on Failure
if: needs.create-test-release.result == 'failure' || needs.publish_wasm_test.result == 'failure'
uses: actions/github-script@v7
continue-on-error: true
env:
COMMENT_ID: ${{ needs.create-test-release.outputs.comment_id }}
with:
script: |
try {
const commentId = parseInt(process.env.COMMENT_ID, 10);
console.log(`Updating comment with ID: ${commentId}`);
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: commentId,
body: `❌ Test release failed. Please check the workflow logs for more details.`
});
} catch (err) {
console.error(err);
}