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

fixed prev error Dependabot/pip/kedro 0.19.6 #148

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion .github/actions/e2e_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ runs:
shell: bash
run: |
pip install $(find "./dist" -name "*.tar.gz")
kedro new --starter spaceflights --config tests/conf/${{ inputs.e2e_config }}/starter-config.yml --verbose
kedro new --starter spaceflights-pandas --config tests/conf/${{ inputs.e2e_config }}/starter-config.yml --verbose

- name: Install starter requirements
shell: bash
Expand Down
9 changes: 5 additions & 4 deletions kedro_azureml/auth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ def get_azureml_credentials():
# On a AzureML compute instance, the managed identity will take precedence,
# while it does not have enough permissions.
# So, if we are on an AzureML compute instance, we disable the managed identity.
is_azureml_managed_identity = "MSI_ENDPOINT" in os.environ
credential = DefaultAzureCredential(
exclude_managed_identity_credential=is_azureml_managed_identity
)
# is_azureml_managed_identity = "MSI_ENDPOINT" in os.environ
# credential = DefaultAzureCredential(
# exclude_managed_identity_credential=is_azureml_managed_identity
# )
credential = DefaultAzureCredential()
# Check if given credential can get token successfully.
credential.get_token("https://management.azure.com/.default")
except Exception:
Expand Down
3 changes: 1 addition & 2 deletions kedro_azureml/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ def run(
), f"Cluster {config.compute['__default__'].cluster_name} does not exist"

logger.info(
f"Creating job on cluster {cluster.name} ({cluster.size}, min instances: {cluster.min_instances}, "
f"max instances: {cluster.max_instances})"
f"Creating job on cluster {cluster.name} ({cluster.size})"
)

pipeline_job = ml_client.jobs.create_or_update(
Expand Down
7 changes: 5 additions & 2 deletions kedro_azureml/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def after_context_created(self, context) -> None:

@hook_impl
def after_catalog_created(self, catalog):
for dataset_name, dataset in catalog._data_sets.items():
print(dir(catalog))
print(catalog.__dict__)
for dataset_name, dataset in catalog._datasets.items():
if isinstance(dataset, AzureMLAssetDataset):
dataset.azure_config = self.azure_config
catalog.add(dataset_name, dataset, replace=True)
Expand All @@ -31,7 +33,8 @@ def before_pipeline_run(self, run_params, pipeline, catalog):
pipeline: The ``Pipeline`` object representing the pipeline to be run.
catalog: The ``DataCatalog`` from which to fetch data.
"""
for dataset_name, dataset in catalog._data_sets.items():
print(catalog)
for dataset_name, dataset in catalog._datasets.items():
if isinstance(dataset, AzureMLAssetDataset):
if AzurePipelinesRunner.__name__ not in run_params["runner"]:
# when running locally using an AzureMLAssetDataset
Expand Down
9 changes: 6 additions & 3 deletions kedro_azureml/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from kedro.config import (
AbstractConfigLoader,
ConfigLoader,
OmegaConfigLoader,
MissingConfigException,
)
from kedro.framework.session import KedroSession
Expand Down Expand Up @@ -54,7 +54,7 @@ def plugin_config(self) -> KedroAzureMLConfig:
obj = None

if obj is None:
if not isinstance(cl, ConfigLoader):
if not isinstance(cl, OmegaConfigLoader):
raise ValueError(
f"You're using a custom config loader: {cl.__class__.__qualname__}{os.linesep}"
f"you need to add the azureml config to it.{os.linesep}"
Expand All @@ -74,8 +74,11 @@ def plugin_config(self) -> KedroAzureMLConfig:
return KedroAzureMLConfig.parse_obj(obj)

def __enter__(self):
# self.session = KedroSession.create(
# self.package_name, env=self.env, extra_params=self.extra_params
# )
self.session = KedroSession.create(
self.package_name, env=self.env, extra_params=self.extra_params
project_path=None, env=self.env, extra_params=self.extra_params
)
return self

Expand Down
2 changes: 1 addition & 1 deletion kedro_azureml/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def create_default_data_set(self, ds_name: str) -> AbstractDataset:
)
else:
# TODO: handle credentials better (probably with built-in Kedro credentials
# via ConfigLoader (but it's not available here...)
# via OmegaConfigLoader (but it's not available here...)
dataset_cls = KedroAzureRunnerDataset
if is_distributed_environment():
logger.info("Using distributed dataset class as a default")
Expand Down
Loading