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

Added customer config #4

Merged
merged 9 commits into from
Jul 29, 2024
Merged

Added customer config #4

merged 9 commits into from
Jul 29, 2024

Conversation

kartikay-bagla
Copy link
Collaborator

Changes

Tests

  • make test run locally
  • make fmt applied
  • relevant integration tests applied

Copy link

github-actions bot commented Jul 17, 2024

This PR breaks backwards compatibility for databrickslabs/blueprint downstream. See build logs for more details.

Running from downstreams #12

Copy link

github-actions bot commented Jul 17, 2024

This PR breaks backwards compatibility for databrickslabs/ucx downstream. See build logs for more details.

Running from downstreams #12

from pyspark.sql.session import SparkSession


class CustomerConfig:
Copy link
Member

Choose a reason for hiding this comment

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

can you also add the set function, incase we are going to need it. It can be handy.

)
logger.info(f"Num additional clusters: {len(ci_add_l)}.")
for ci in ci_add_l:
if ci not in [i.cluster_id for i in cl]:
Copy link
Member

Choose a reason for hiding this comment

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

You can create one cluster id set after getting information and can check the ci in cluster_ids

cluster_ids = set([i.cluster_id for i in cl])
for ci in ci_add_l:
    if ci not in cluster_ids:

Comment on lines 114 to 121
logger.info(f"Clusters to be removed: {len(ci_remove_l)}.")
for ci in ci_remove_l:
for i, c in enumerate(cl):
if ci == c.cluster_id:
logger.info(f"Removing cluster ID {ci}.")
cl.pop(i)
break
logger.info(f"Current cluster count: {len(cl)}")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
logger.info(f"Clusters to be removed: {len(ci_remove_l)}.")
for ci in ci_remove_l:
for i, c in enumerate(cl):
if ci == c.cluster_id:
logger.info(f"Removing cluster ID {ci}.")
cl.pop(i)
break
logger.info(f"Current cluster count: {len(cl)}")
logger.info(f"Clusters to be removed: {len(ci_remove_l)}.")
ci_remove_ids = set(ci_remove_l)
final_cluster = [cluster for cluster in cl if cluster.cluster_id not in ci_remove_ids]
logger.info(f"Current cluster count: {len(cl)}")
return final_cluster

@manassolanki manassolanki merged commit c393f6a into main Jul 29, 2024
4 of 9 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.

2 participants