Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use query stream for automatic data update script #224

Merged
merged 8 commits into from
Aug 7, 2024

Conversation

Nigui
Copy link
Contributor

@Nigui Nigui commented Aug 6, 2024

Hello,

While customizing SQL queries for future PRs, I got an error due to very large query results from big query.

Issue occurs because of JSON.stringify can't be handle very large json results. It throws RangeError: Invalid string length. This issue makes script not scalable.
Moving to stream fixes the issue as data is handled row by row (written to file and inserted in db).

Overwrite lighthouse-infrastructure project

This MR also adds a new environment variable OVERRIDE_LH_PROJECT to overwrite project containing third-party-table where script will create a new table (the one where we store mapping between observed domain and canonical one) then queried by entity-per-page.sql. It'll help in case script runner has no write access to hardcoded project in sql script (i.e lighthouse-infrastructure).

Copy link

vercel bot commented Aug 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
third-party-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2024 2:38pm

Copy link
Owner

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you so very much for the contribution! this is great!

bin/automated-update.js Outdated Show resolved Hide resolved
Co-authored-by: Patrick Hulce <[email protected]>
@patrickhulce patrickhulce merged commit 82f1900 into patrickhulce:master Aug 7, 2024
7 checks passed
@Kporal Kporal deleted the feat/use-query-stream branch August 26, 2024 12:18
Copy link

🎉 This PR is included in version 0.25.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants