-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
This PR breaks backwards compatibility for databrickslabs/blueprint downstream. See build logs for more details. Running from downstreams #12 |
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: |
There was a problem hiding this comment.
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]: |
There was a problem hiding this comment.
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:
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)}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Signed-off-by: Kartikay Bagla <kartikaybagla@gmail.com>
feat: added cluster ids from jobs system tables
Changes
Tests
make test
run locallymake fmt
applied