-
-
Notifications
You must be signed in to change notification settings - Fork 209
Lint only changed SQL files on PRs #4254
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7bfb9e8
Include sql/** in lint workflow and lint only changed SQL files on PRs
max-ostapenko 1ba5ef2
Remove step-level if from Lint SQL
max-ostapenko 390d814
Add -q to pip install
max-ostapenko 0dd3af7
Break long shell lines in Lint SQL workflow for readability
max-ostapenko b97a953
Disable SQLFluff in global super-linter and move Dependabot auto-merg…
max-ostapenko 1a73764
remove explicit VALIDATE_SQLFLUFF:false
max-ostapenko 7be5d4d
Merge branch 'main' into fine-lungfish
max-ostapenko 7f4e225
linting
max-ostapenko 5839f97
Restrict Lint SQL workflow PR path to .sql files
max-ostapenko a3be849
remove outer query
max-ostapenko 4adbe1c
Merge branch 'main' into fine-lungfish
max-ostapenko 56ddf77
Merge branch 'main' into fine-lungfish
max-ostapenko 00f041b
unwraped subqueries
max-ostapenko 4e14b5a
Update sql/2021/css/keyframes_positions.sql
max-ostapenko 7650eea
Update sql/2021/css/image_dimension_popularity.sql
max-ostapenko ac260fc
Apply suggestion from @tunetheweb
tunetheweb ef1da58
Merge branch 'main' into fine-lungfish
max-ostapenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,19 @@ | ||
| #standardSQL | ||
| # 06_32: Top font hosts | ||
| SELECT | ||
| * | ||
| FROM ( | ||
| SELECT | ||
| client, | ||
| NET.HOST(url) AS host, | ||
| COUNT(0) AS freq, | ||
| SUM(COUNT(0)) OVER (PARTITION BY client) AS total, | ||
| ROUND(COUNT(0) * 100 / SUM(COUNT(0)) OVER (PARTITION BY client), 2) AS pct | ||
| FROM | ||
| `httparchive.almanac.requests` | ||
| WHERE | ||
| date = '2019-07-01' AND | ||
| type = 'font' | ||
| GROUP BY | ||
| client, | ||
| host | ||
| ORDER BY | ||
| freq / total DESC | ||
| ) | ||
| client, | ||
| NET.HOST(url) AS host, | ||
| COUNT(0) AS freq, | ||
| SUM(COUNT(0)) OVER (PARTITION BY client) AS total, | ||
| ROUND(COUNT(0) * 100 / SUM(COUNT(0)) OVER (PARTITION BY client), 2) AS pct | ||
| FROM | ||
| `httparchive.almanac.requests` | ||
| WHERE | ||
| date = '2019-07-01' AND | ||
| type = 'font' | ||
| GROUP BY | ||
| client, | ||
| host | ||
| ORDER BY | ||
| freq / total DESC | ||
| LIMIT 100 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,59 +1,55 @@ | ||
| #standardSQL | ||
| # CSS-initiated image px dimension popularity | ||
| SELECT | ||
| * | ||
| client, | ||
| height, | ||
| width, | ||
| COUNT(0) AS freq, | ||
| SUM(COUNT(0)) OVER (PARTITION BY client) AS total, | ||
| COUNT(0) / SUM(COUNT(0)) OVER (PARTITION BY client) AS pct | ||
| FROM ( | ||
| SELECT | ||
| client, | ||
| height, | ||
| width, | ||
| COUNT(0) AS freq, | ||
| SUM(COUNT(0)) OVER (PARTITION BY client) AS total, | ||
| COUNT(0) / SUM(COUNT(0)) OVER (PARTITION BY client) AS pct | ||
| FROM ( | ||
| SELECT | ||
| client, | ||
| page, | ||
| url AS img_url, | ||
| JSON_VALUE(payload, '$._initiator') AS css_url | ||
| FROM | ||
| `httparchive.almanac.requests` | ||
| WHERE | ||
| date = '2021-07-01' AND | ||
| type = 'image' | ||
| ) | ||
| JOIN ( | ||
| SELECT | ||
| client, | ||
| page, | ||
| url AS css_url | ||
| FROM | ||
| `httparchive.almanac.requests` | ||
| WHERE | ||
| date = '2021-07-01' AND | ||
| type = 'css' | ||
| ) | ||
| USING (client, page, css_url) | ||
| JOIN ( | ||
| SELECT | ||
| _TABLE_SUFFIX AS client, | ||
| url AS page, | ||
| JSON_EXTRACT_SCALAR(image, '$.url') AS img_url, | ||
| SAFE_CAST(JSON_EXTRACT_SCALAR(image, '$.naturalHeight') AS INT64) AS height, | ||
| SAFE_CAST(JSON_EXTRACT_SCALAR(image, '$.naturalWidth') AS INT64) AS width | ||
| FROM | ||
| `httparchive.pages.2021_07_01_*`, | ||
| UNNEST(JSON_EXTRACT_ARRAY(JSON_EXTRACT_SCALAR(payload, '$._Images'), '$')) AS image | ||
| ) | ||
| USING (client, page, img_url) | ||
| page, | ||
| url AS img_url, | ||
| JSON_VALUE(payload, '$._initiator') AS css_url | ||
| FROM | ||
| `httparchive.almanac.requests` | ||
| WHERE | ||
| height IS NOT NULL AND | ||
| width IS NOT NULL | ||
| GROUP BY | ||
| date = '2021-07-01' AND | ||
| type = 'image' | ||
| ) | ||
| JOIN ( | ||
| SELECT | ||
| client, | ||
| height, | ||
| width | ||
| ORDER BY | ||
| pct DESC | ||
| page, | ||
| url AS css_url | ||
| FROM | ||
| `httparchive.almanac.requests` | ||
| WHERE | ||
| date = '2021-07-01' AND | ||
| type = 'css' | ||
| ) | ||
| USING (client, page, css_url) | ||
| JOIN ( | ||
| SELECT | ||
| _TABLE_SUFFIX AS client, | ||
| url AS page, | ||
| JSON_EXTRACT_SCALAR(image, '$.url') AS img_url, | ||
| SAFE_CAST(JSON_EXTRACT_SCALAR(image, '$.naturalHeight') AS INT64) AS height, | ||
| SAFE_CAST(JSON_EXTRACT_SCALAR(image, '$.naturalWidth') AS INT64) AS width | ||
| FROM | ||
| `httparchive.pages.2021_07_01_*`, | ||
| UNNEST(JSON_EXTRACT_ARRAY(JSON_EXTRACT_SCALAR(payload, '$._Images'), '$')) AS image | ||
| ) | ||
| USING (client, page, img_url) | ||
| WHERE | ||
| height IS NOT NULL AND | ||
| width IS NOT NULL | ||
| GROUP BY | ||
| client, | ||
| height, | ||
| width | ||
| ORDER BY | ||
| pct DESC | ||
|
max-ostapenko marked this conversation as resolved.
|
||
| LIMIT 500 | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,4 @@ FROM | |
| WHERE | ||
| methodology = '2022' AND | ||
| date = '2022-06-01' | ||
| LIMIT 1000 | ||
| LIMIT 1000 -- noqa: AM09 | ||
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
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
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
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
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.