Skip to main content

Making VDK smarter by employing ML/AI.

Project description

VDK Smarter

monthly download count for vdk-smarter

Making VDK smarter by employing ML/AI.

Usage

pip install vdk-smarter

Configuration

(vdk config-help is useful command to browse all config options of your installation of vdk)

Example

TODO# VDK Smarter

Making VDK smarter by employing ML/AI.

Usage

pip install vdk-smarter

Configuration

(vdk config-help and search for configuration starting with "openai")

Example

By default reviews are disabled since they are expensive.

To enable you need to set openai_review_enabled to true in the configuration and openai_api_key. You can see vdk config-help (search for configuration with openai prefix) for more information.

Once enabled on vdk run each query statement executed will be also reviewed and scored.

vdk run example
Query:
CREATE TABLE IF NOT EXISTS super_collider.example_table(
   vc_id STRING,
   esx_id STRING,
   vm_count INT
) STORED AS PARQUET;


Review:
  {
    "score": 5,
    "review": "No further changes needed. The query is efficient, readable, and follows best practices.
               There are no potential errors, optimization, or security vulnerabilities."}

...
Query:
CREATE TABLE IF NOT EXISTS super_collider.example_fact_snapshot(
                  vc_id STRING,
                  esx_count BIGINT,
                  vm_count BIGINT
) STORED AS PARQUET;


Review:
{"score": 4, "review": "The query is well-structured and follows best practices.
                        However, there is an opportunity to improve its readability by
                        adding comments to explain the purpose of the query  and the meaning of the parameters.
                        Additionally, there is potential to optimize the query by providing more precise column types."}

At the end a report is generated queries_reviews_report.md with all the queries and their reviews.

Build and testing

pip install -r requirements.txt
pip install -e .
pytest

In VDK repo ../build-plugin.sh script can be used also.

Note about the CICD:

.plugin-ci.yaml is needed only for plugins part of Versatile Data Kit Plugin repo.

The CI/CD is separated in two stages, a build stage and a release stage. The build stage is made up of a few jobs, all which inherit from the same job configuration and only differ in the Python version they use (3.7, 3.8, 3.9 and 3.10). They run according to rules, which are ordered in a way such that changes to a plugin's directory trigger the plugin CI, but changes to a different plugin does not.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vdk_smarter-0.1.1431637373.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file vdk_smarter-0.1.1431637373.tar.gz.

File metadata

  • Download URL: vdk_smarter-0.1.1431637373.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for vdk_smarter-0.1.1431637373.tar.gz
Algorithm Hash digest
SHA256 a0d96a27ef44d5d8f3b99fe1151ccd637df8abdfc92332b1a7d9bb86bea0ebb0
MD5 038e69a21516bd02d47a887a8bc6a7c2
BLAKE2b-256 6a5913706d7ac5a736adb69c549528b3bd0944a3264380df25b17f82e3ca07ec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page