Skip to content

Commit

Permalink
Merge pull request #12 from abhinavchobey/master
Browse files Browse the repository at this point in the history
Fixed 17 more pylint errors from cmflib
  • Loading branch information
annmary-roy authored Sep 8, 2022
2 parents 860e293 + 53c384a commit 9d736cf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions cmflib/dvc_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def dvc_get_hash(folder: str, repo: str = "") -> str:


def git_get_commit() -> str:
process = ""
commit = ""
try:
process = subprocess.Popen(['git', 'rev-parse', 'HEAD'],
stdout=subprocess.PIPE,
Expand All @@ -73,6 +75,7 @@ def git_get_commit() -> str:

def commit_dvc_lock_file(file_path: str, execution_id) -> str:
commit = ""
process = ""
try:
process = subprocess.Popen(['git', 'add', file_path],
stdout=subprocess.PIPE,
Expand Down Expand Up @@ -102,6 +105,7 @@ def commit_dvc_lock_file(file_path: str, execution_id) -> str:

def commit_output(folder: str, execution_id: str) -> str:
commit = ""
process = ""
try:
process = subprocess.Popen(['dvc', 'add', folder],
stdout=subprocess.PIPE,
Expand Down Expand Up @@ -140,6 +144,9 @@ def commit_output(folder: str, execution_id: str) -> str:
# Get the remote repo
def git_get_repo() -> str:
commit = ""
process = ""
output = ""
errs = ""
try:
process = subprocess.Popen(['git', 'remote', '-v'],
stdout=subprocess.PIPE,
Expand Down
13 changes: 9 additions & 4 deletions cmflib/metadata_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def get_or_create_artifact_type(store, type_name, properties: dict = None) -> me
try:
artifact_type = store.get_artifact_type(type_name=type_name)
return artifact_type
except:
except Exception as e:
print(e)
artifact_type = metadata_store_pb2.ArtifactType(
name=type_name,
properties=properties,
Expand All @@ -99,7 +100,8 @@ def get_or_create_execution_type(store, type_name, properties: dict = None) -> m
try:
execution_type = store.get_execution_type(type_name=type_name)
return execution_type
except:
except Exception as e:
print(e)
execution_type = metadata_store_pb2.ExecutionType(
name=type_name,
properties=properties,
Expand All @@ -112,7 +114,8 @@ def get_or_create_context_type(store, type_name, properties: dict = None) -> met
try:
context_type = store.get_context_type(type_name=type_name)
return context_type
except:
except Exception as e:
print(e)
context_type = metadata_store_pb2.ContextType(
name=type_name,
properties=properties,
Expand Down Expand Up @@ -213,7 +216,8 @@ def get_or_create_context_with_type(
) -> metadata_store_pb2.Context:
try:
context = get_context_by_name(store, context_name)
except:
except Exception as e:
print(e)
context = create_context_with_type(
store=store,
context_name=context_name,
Expand Down Expand Up @@ -340,6 +344,7 @@ def associate_child_to_parent_context(store, parent_context: metadata_store_pb2.
associate = metadata_store_pb2.ParentContext(child_id=child_context.id, parent_id=parent_context.id)
store.put_parent_contexts([associate])
except Exception as e:
print(e)
# print('Warning: Exception:{}'.format(str(e)), file=sys.stderr)
sys.stderr.flush()

Expand Down

0 comments on commit 9d736cf

Please sign in to comment.