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

Feat/add cli export assessment reviewed #21

Conversation

jgarciaf106
Copy link
Collaborator

Changes

Notes

Code based on UCX v0.38.0.

Functionality

  • added relevant user documentation
  • added new CLI command
  • modified existing command: databricks labs ucx ...
  • added a new workflow
  • modified existing workflow: ...
  • added a new table
  • modified existing table: ...

Tests

  • manually tested
  • added unit tests
  • added integration tests
  • verified on staging environment (videos attached)
manual_test_export_assessment_cli.mov
manual_test_export_assessment_notebook.mov

ericvergnaud and others added 7 commits September 30, 2024 14:08
## Changes
Currently, `solacc` outputs advices to the console, and does not keep
track of linting time.
This PR:
 - dumps advices to an 'advices.txt' file
- collects stats and dumps them to a 'stats.json' file (in the form of a
json-like file, with 1 json object per line)
 - uploads the above 

### Linked issues
None

### Functionality
None

### Tests
- [x] manually tested:

Sample solacc run:
![Screenshot 2024-09-27 at 16 44
22](https://github.com/user-attachments/assets/a0f508e4-4095-45b8-be38-51d08824b15e)

Sample stats.json (expanded):
```
{
  "run_id": "1",
  "name": "ab-testing",
  "start_timestamp": "2024-09-27 10:16:02.512363+00:00",
  "end_timestamp": "2024-09-27 10:17:07.622161+00:00",
  "files_count": 6,
  "files_size": 34934
}
{
  "run_id": "1",
  "name": "adverse-drug-events",
  "start_timestamp": "2024-09-27 10:17:08.669225+00:00",
  "end_timestamp": "2024-09-27 10:17:09.399495+00:00",
  "files_count": 5,
  "files_size": 48743
}
{
  "run_id": "1",
  "name": "als-recommender",
  "start_timestamp": "2024-09-27 10:17:09.565942+00:00",
  "end_timestamp": "2024-09-27 10:17:12.039422+00:00",
  "files_count": 6,
  "files_size": 62750
}
```


Sample advices.txt:
```
./dist/ab-testing/4. Real time inference.py:76:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/ab-testing/4. Real time inference.py:139:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters
./dist/ab-testing/4. Real time inference.py:139:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/ab-testing/RUNME.py:1:1: [library-install-failed] Unsupported 'pip' command: DBTITLE
./dist/ab-testing/5. AB testing metrics.py:50:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters
./dist/ab-testing/5. AB testing metrics.py:50:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/ab-testing/5. AB testing metrics.py:51:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters
./dist/ab-testing/5. AB testing metrics.py:51:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/ab-testing/5. AB testing metrics.py:54:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters
./dist/ab-testing/5. AB testing metrics.py:54:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/ab-testing/5. AB testing metrics.py:58:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters
./dist/ab-testing/5. AB testing metrics.py:58:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/ab-testing/2. Model training.py:34:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters
./dist/ab-testing/2. Model training.py:34:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/ab-testing/2. Model training.py:36:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/ab-testing/2. Model training.py:37:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/ab-testing/2. Model training.py:37:0: [rdd-in-shared-clusters] RDD APIs are not supported on UC Shared Clusters. Rewrite it using DataFrame API
./dist/ab-testing/2. Model training.py:38:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters
./dist/ab-testing/2. Model training.py:41:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters
./dist/ab-testing/2. Model training.py:41:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/ab-testing/5. AB testing metrics.py:22:0: [default-format-changed-in-dbr8] The default format changed in Databricks Runtime 8.0, from Parquet to Delta
./dist/ab-testing/5. AB testing metrics.py:36:27: [default-format-changed-in-dbr8] The default format changed in Databricks Runtime 8.0, from Parquet to Delta
./dist/ab-testing/5. AB testing metrics.py:90:2: [default-format-changed-in-dbr8] The default format changed in Databricks Runtime 8.0, from Parquet to Delta
./dist/ab-testing/5. AB testing metrics.py:97:2: [default-format-changed-in-dbr8] The default format changed in Databricks Runtime 8.0, from Parquet to Delta
./dist/ab-testing/risk_demo.dbdash:1:0: [unknown-language] Cannot detect language for /home/runner/work/ucx/ucx/dist/ab-testing/risk_demo.dbdash
./dist/ab-testing/1. Introduction.py:72:2: [direct-filesystem-access] The use of direct filesystem references is deprecated: /tmp/german_credit_data.csv
./dist/ab-testing/4. Real time inference.py:10:0: [direct-filesystem-access] The use of direct filesystem references is deprecated: /FileStore/tmp/streaming_ckpnt_risk_demo
./dist/ab-testing/4. Real time inference.py:10:14: [direct-filesystem-access] The use of direct filesystem references is deprecated: /FileStore/tmp/streaming_ckpnt_risk_demo
./dist/ab-testing/4. Real time inference.py:29:5: [default-format-changed-in-dbr8] The default format changed in Databricks Runtime 8.0, from Parquet to Delta
./dist/ab-testing/4. Real time inference.py:214:32: [direct-filesystem-access] The use of direct filesystem references is deprecated: /FileStore/tmp/streaming_ckpnt_risk_demo
./dist/ab-testing/4. Real time inference.py:236:2: [default-format-changed-in-dbr8] The default format changed in Databricks Runtime 8.0, from Parquet to Delta
./dist/ab-testing/4. Real time inference.py:254:27: [default-format-changed-in-dbr8] The default format changed in Databricks Runtime 8.0, from Parquet to Delta
./dist/ab-testing/2. Model training.py:53:22: [direct-filesystem-access] The use of direct filesystem references is deprecated: /Users/Uninferable/german_credit_experiment
./dist/ab-testing/2. Model training.py:66:5: [default-format-changed-in-dbr8] The default format changed in Databricks Runtime 8.0, from Parquet to Delta
./dist/ab-testing/2. Model training.py:197:67: [direct-filesystem-access] The use of direct filesystem references is deprecated: /tmp/pr-curve-model-a.png
./dist/ab-testing/2. Model training.py:229:67: [direct-filesystem-access] The use of direct filesystem references is deprecated: /tmp/pr-curve-model-b.png
./dist/adverse-drug-events/RUNME.py:1:1: [library-install-failed] Unsupported 'pip' command: DBTITLE
./dist/adverse-drug-events/01-ade-extraction.py:23:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters
./dist/adverse-drug-events/01-ade-extraction.py:23:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/adverse-drug-events/02-ade-analysis.py:13:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters
./dist/adverse-drug-events/02-ade-analysis.py:13:0: [legacy-context-in-shared-clusters] sc is not supported on UC Shared Clusters. Rewrite it using spark
./dist/adverse-drug-events/02-ade-analysis.py:14:0: [jvm-access-in-shared-clusters] Cannot access Spark Driver JVM on UC Shared Clusters

```

---------

Co-authored-by: Eric Vergnaud <eric.vergnaud@databricks.com>
## Changes

This PR simply adds in some missing generic annotations for crawler
implementations.
…atabrickslabs#2765)

Updates the requirements on
[sqlglot](https://github.com/tobymao/sqlglot) to permit the latest
version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tobymao/sqlglot/blob/main/CHANGELOG.md">sqlglot's
changelog</a>.</em></p>
<blockquote>
<h2>[v25.24.0] - 2024-09-26</h2>
<h3>:boom: BREAKING CHANGES</h3>
<ul>
<li>
<p>due to <a
href="https://github.com/tobymao/sqlglot/commit/3ab6dfb486f18d036bfac6a90d5f81b0ce7a91ea"><code>3ab6dfb</code></a>
- Generalize COLUMNS(...) APPLY <em>(PR <a
href="https://redirect.github.com/tobymao/sqlglot/pull/4161">#4161</a>
by <a
href="https://github.com/VaggelisD"><code>@​VaggelisD</code></a>)</em>:</p>
<p>Generalize COLUMNS(...) APPLY (<a
href="https://redirect.github.com/tobymao/sqlglot/issues/4161">#4161</a>)</p>
</li>
</ul>
<h3>:sparkles: New Features</h3>
<ul>
<li><a
href="https://github.com/tobymao/sqlglot/commit/93cef30bc534a155bce06f35d441d20e5dd78cf6"><code>93cef30</code></a>
- <strong>postgres</strong>: Support OVERLAY function <em>(PR <a
href="https://redirect.github.com/tobymao/sqlglot/pull/4165">#4165</a>
by <a
href="https://github.com/VaggelisD"><code>@​VaggelisD</code></a>)</em>
<ul>
<li>:arrow_lower_right: <em>addresses issue <a
href="https://redirect.github.com/tobymao/sqlglot/issues/4159">#4159</a>
opened by <a
href="https://github.com/s1101010110"><code>@​s1101010110</code></a></em></li>
</ul>
</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/0a5444dc822b7c53c008bc946eb3b54ca2147f3c"><code>0a5444d</code></a>
- expose a flag to automatically exclude Keep diff nodes <em>(PR <a
href="https://redirect.github.com/tobymao/sqlglot/pull/4168">#4168</a>
by <a
href="https://github.com/georgesittas"><code>@​georgesittas</code></a>)</em></li>
</ul>
<h3>:bug: Bug Fixes</h3>
<ul>
<li><a
href="https://github.com/tobymao/sqlglot/commit/9c172643aa3f3f0ffcc2e62242b62ba9c6141925"><code>9c17264</code></a>
- <strong>hive</strong>: Enclose exp.Split with \E <em>(PR <a
href="https://redirect.github.com/tobymao/sqlglot/pull/4163">#4163</a>
by <a
href="https://github.com/VaggelisD"><code>@​VaggelisD</code></a>)</em>
<ul>
<li>:arrow_lower_right: <em>fixes issue <a
href="https://redirect.github.com/tobymao/sqlglot/issues/4158">#4158</a>
opened by <a
href="https://github.com/cpcloud"><code>@​cpcloud</code></a></em></li>
</ul>
</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/3ab6dfb486f18d036bfac6a90d5f81b0ce7a91ea"><code>3ab6dfb</code></a>
- <strong>clickhouse</strong>: Generalize COLUMNS(...) APPLY <em>(PR <a
href="https://redirect.github.com/tobymao/sqlglot/pull/4161">#4161</a>
by <a
href="https://github.com/VaggelisD"><code>@​VaggelisD</code></a>)</em>
<ul>
<li>:arrow_lower_right: <em>fixes issue <a
href="https://redirect.github.com/tobymao/sqlglot/issues/4157">#4157</a>
opened by <a
href="https://github.com/elchyn-cheliabiyeu"><code>@​elchyn-cheliabiyeu</code></a></em></li>
</ul>
</li>
</ul>
<h3>:recycle: Refactors</h3>
<ul>
<li><a
href="https://github.com/tobymao/sqlglot/commit/2540e50d2b0df12f940c68acc574e540d19546cf"><code>2540e50</code></a>
- simplify check_deploy job <em>(commit by <a
href="https://github.com/georgesittas"><code>@​georgesittas</code></a>)</em></li>
</ul>
<h3>:wrench: Chores</h3>
<ul>
<li><a
href="https://github.com/tobymao/sqlglot/commit/f6d3bdd740d0fe128d4d5dd99833a6f71c890ed3"><code>f6d3bdd</code></a>
- update supported dialect count (21 -&gt; 23) <em>(commit by <a
href="https://github.com/georgesittas"><code>@​georgesittas</code></a>)</em></li>
</ul>
<h2>[v25.23.2] - 2024-09-25</h2>
<h3>:wrench: Chores</h3>
<ul>
<li><a
href="https://github.com/tobymao/sqlglot/commit/eca05d3b08645d7a984ee65b438282b35cb41960"><code>eca05d3</code></a>
- tweak should_deploy_rs script to avoid marking CI as failed
<em>(commit by <a
href="https://github.com/georgesittas"><code>@​georgesittas</code></a>)</em></li>
</ul>
<h2>[v25.23.1] - 2024-09-25</h2>
<h3>:wrench: Chores</h3>
<ul>
<li><a
href="https://github.com/tobymao/sqlglot/commit/349b8f81ed69a3708e1afd15816b3b58e2bf8b3f"><code>349b8f8</code></a>
- fetch all history to allow workflow script to skip sqlglotrs
deployments <em>(PR <a
href="https://redirect.github.com/tobymao/sqlglot/pull/4162">#4162</a>
by <a
href="https://github.com/georgesittas"><code>@​georgesittas</code></a>)</em></li>
</ul>
<h2>[v25.23.0] - 2024-09-25</h2>
<h3>:boom: BREAKING CHANGES</h3>
<ul>
<li>
<p>due to <a
href="https://github.com/tobymao/sqlglot/commit/da51ea5c8f405859d877a25176e8e48ef8b4b112"><code>da51ea5</code></a>
- refactor exp.Chr <em>(PR <a
href="https://redirect.github.com/tobymao/sqlglot/pull/4081">#4081</a>
by <a
href="https://github.com/georgesittas"><code>@​georgesittas</code></a>)</em>:</p>
<p>refactor exp.Chr (<a
href="https://redirect.github.com/tobymao/sqlglot/issues/4081">#4081</a>)</p>
</li>
<li>
<p>due to <a
href="https://github.com/tobymao/sqlglot/commit/9c527b549cc56db9d8f44579397d9f9fe1440573"><code>9c527b5</code></a>
- treat Nullable as an arg instead of a DataType.TYPE <em>(PR <a
href="https://redirect.github.com/tobymao/sqlglot/pull/4094">#4094</a>
by <a
href="https://github.com/georgesittas"><code>@​georgesittas</code></a>)</em>:</p>
<p>treat Nullable as an arg instead of a DataType.TYPE (<a
href="https://redirect.github.com/tobymao/sqlglot/issues/4094">#4094</a>)</p>
</li>
<li>
<p>due to <a
href="https://github.com/tobymao/sqlglot/commit/ba015dc1102a4fe0c35cbfe6e3d23dc24263c20f"><code>ba015dc</code></a>
- add <code>returning</code> to merge expression builder <em>(PR <a
href="https://redirect.github.com/tobymao/sqlglot/pull/4125">#4125</a>
by <a
href="https://github.com/max-muoto"><code>@​max-muoto</code></a>)</em>:</p>
<p>add <code>returning</code> to merge expression builder (<a
href="https://redirect.github.com/tobymao/sqlglot/issues/4125">#4125</a>)</p>
</li>
<li>
<p>due to <a
href="https://github.com/tobymao/sqlglot/commit/77a514dd7cfa9feb847c429411809092e5578bad"><code>77a514d</code></a>
- Parse VALUES &amp; query modifiers in wrapped FROM clause <em>(PR <a
href="https://redirect.github.com/tobymao/sqlglot/pull/4135">#4135</a>
by <a
href="https://github.com/VaggelisD"><code>@​VaggelisD</code></a>)</em>:</p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/tobymao/sqlglot/commit/73cd334d4c2582134591ce4812f439705c364941"><code>73cd334</code></a>
Cleanup</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/0a5444dc822b7c53c008bc946eb3b54ca2147f3c"><code>0a5444d</code></a>
Feat: expose a flag to automatically exclude Keep diff nodes (<a
href="https://redirect.github.com/tobymao/sqlglot/issues/4168">#4168</a>)</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/93cef30bc534a155bce06f35d441d20e5dd78cf6"><code>93cef30</code></a>
feat(postgres): Support OVERLAY function (<a
href="https://redirect.github.com/tobymao/sqlglot/issues/4165">#4165</a>)</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/3ab6dfb486f18d036bfac6a90d5f81b0ce7a91ea"><code>3ab6dfb</code></a>
fix(clickhouse)!: Generalize COLUMNS(...) APPLY (<a
href="https://redirect.github.com/tobymao/sqlglot/issues/4161">#4161</a>)</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/f6d3bdd740d0fe128d4d5dd99833a6f71c890ed3"><code>f6d3bdd</code></a>
Chore: update supported dialect count (21 -&gt; 23)</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/2540e50d2b0df12f940c68acc574e540d19546cf"><code>2540e50</code></a>
Refactor: simplify check_deploy job</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/9c172643aa3f3f0ffcc2e62242b62ba9c6141925"><code>9c17264</code></a>
fix(hive): Enclose exp.Split with \E (<a
href="https://redirect.github.com/tobymao/sqlglot/issues/4163">#4163</a>)</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/abafa607a877f1f981944155b45110f917536f48"><code>abafa60</code></a>
docs: update API docs, CHANGELOG.md for v25.23.2 [skip ci]</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/eca05d3b08645d7a984ee65b438282b35cb41960"><code>eca05d3</code></a>
Chore: tweak should_deploy_rs script to avoid marking CI as failed</li>
<li><a
href="https://github.com/tobymao/sqlglot/commit/0778c29d6c675e86fd50962cf4db73e685a78af1"><code>0778c29</code></a>
docs: update API docs, CHANGELOG.md for v25.23.1 [skip ci]</li>
<li>Additional commits viewable in <a
href="https://github.com/tobymao/sqlglot/compare/v25.5.0...v25.24.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@rportilla-databricks
Copy link
Owner

Code reviewed and integration tests run for CLI command

@rportilla-databricks rportilla-databricks merged commit 84830fd into rportilla-databricks:main Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants