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

Databricks/client creds input validation #1149

Merged

Conversation

ihkap11
Copy link
Contributor

@ihkap11 ihkap11 commented Nov 8, 2023

Description

Add validators for Databricks credentials - token id and cluster id, to ensure proper format to avoid confusion with users.

Tests failing before:
===== 104 failed, 383 passed, 14 xfailed, 227 warnings, 5 errors in 45.88s =====
Tests failing after:
===== 103 failed, 384 passed, 19 xfailed, 227 warnings, 5 errors in 45.81s =====

Issue: #1143

Enhancement

Does this correspond to an open issue?

Select type(s) of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have fixed any merge conflicts

ihkap11 and others added 5 commits November 8, 2023 18:41
file: client/src/featureform/resources.py
change logs:
Inside DatabricksCredentials Class
- add @DataClass and __post_init__
- _validate_cluster_id and _validate_token regex validation for cluster_id and token
File: client/tests/test_executor_resources.py
Cases covered:
- valid token and cluster id
- cluster id and token are empty
- have incorrect format or invalid characters
Why? Now that we have cluster_id validator we need to use right format for cluster id.

file: client/tests/conftest.py

change logs:
def databricks():
    return DatabricksCredentials(
        username="a", password="b", cluster_id="abc-123def-ghijklmn"
    )

AND

def spark_provider(ff_registrar):
    databricks = DatabricksCredentials(
        username="a", password="b", cluster_id="abc-123def-ghijklmn"
    )
    azure_blob = AzureFileStoreConfig(
        account_name="", account_key="", container_name="", root_path=""
    )
Copy link
Collaborator

@sdreyer sdreyer left a comment

Choose a reason for hiding this comment

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

Looking good! A few changes

client/src/featureform/resources.py Outdated Show resolved Hide resolved
client/src/featureform/resources.py Outdated Show resolved Hide resolved
client/src/featureform/resources.py Outdated Show resolved Hide resolved
@sdreyer sdreyer merged commit f2cc795 into featureform:main Nov 23, 2023
25 of 35 checks passed
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.

None yet

2 participants