Skip to content

Commit

Permalink
Removed multiple unused modules and non-accessed assignments (#865)
Browse files Browse the repository at this point in the history
* Respect alphabetical order when importing modules

* import sys

* Remove unused module

* Elegantly check the Python version before importing the modules and converting to local time.

* Remove unused module

* Decouple LBYL  from  PR

* ./metaflow/cli.py:18:1 '.util.to_unicode' imported but unused

* ./metaflow/debug.py:3:1 'os' imported but unused

* multiple unused imports

* unused variable

* unused import

* useless varaible assign

* unused imports

* removed junk testing file

Co-authored-by: Savin <savingoyal@gmail.com>
Co-authored-by: Romain <romain-intel@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 3, 2022
1 parent dad0401 commit 17e1148
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 17 deletions.
1 change: 0 additions & 1 deletion metaflow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
decompress_list,
write_latest_run_id,
get_latest_run_id,
to_unicode,
)
from .task import MetaflowTask
from .exception import CommandException, MetaflowException
Expand Down
1 change: 0 additions & 1 deletion metaflow/debug.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import print_function
import sys
import os

from functools import partial

Expand Down
1 change: 0 additions & 1 deletion metaflow/decorators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import traceback
from functools import partial
import re
import os
Expand Down
2 changes: 0 additions & 2 deletions metaflow/flowspec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from itertools import islice
import os
import sys
import inspect
import traceback
from types import FunctionType, MethodType
Expand All @@ -9,7 +8,6 @@
from .parameters import Parameter
from .exception import (
MetaflowException,
MetaflowInternalError,
MissingInMergeArtifactsException,
UnhandledInMergeArtifactsException,
)
Expand Down
3 changes: 0 additions & 3 deletions metaflow/includefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
import io
import json
import os
import pickle
import tempfile

from hashlib import sha1
from shutil import move

import click

Expand Down
4 changes: 2 additions & 2 deletions metaflow/metaflow_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import platform
import sys

from .util import get_username, to_unicode
from .util import get_username
from . import metaflow_version
from metaflow.exception import MetaflowException
from metaflow.mflog import BASH_MFLOG, BASH_SAVE_LOGS
from metaflow.mflog import BASH_MFLOG
from . import R

version_cache = None
Expand Down
1 change: 0 additions & 1 deletion metaflow/multicore_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def parallel_imap_unordered(func, iterable, max_parallel=None, dir=None):
if max_parallel is None:
max_parallel = cpu_count()

ret = []
args_iter = iter(iterable)
pids = [_spawn(func, arg, dir) for arg in islice(args_iter, max_parallel)]

Expand Down
1 change: 0 additions & 1 deletion metaflow/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import time
import json
from io import BytesIO
from itertools import chain

from .metaflow_config import DEFAULT_PACKAGE_SUFFIXES
from .exception import MetaflowException
Expand Down
2 changes: 1 addition & 1 deletion metaflow/pylint_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run(self, logger=None, warnings=False, pylint_config=[]):
try:
pylint_is_happy = True
pylint_exception_msg = ""
run = self._run(args, None, False)
self._run(args, None, False)
except Exception as e:
pylint_is_happy = False
pylint_exception_msg = repr(e)
Expand Down
4 changes: 0 additions & 4 deletions metaflow/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
using local / remote processes
"""
from __future__ import print_function
import json
import os
import sys
import fcntl
import time
import select
import subprocess
from datetime import datetime
from io import BytesIO
Expand All @@ -25,8 +23,6 @@
)
from . import procpoll
from .datastore import TaskDataStoreSet
from .datastore.exceptions import DataException
from .metadata import MetaDatum
from .debug import debug
from .decorators import flow_decorators
from .mflog import mflog, RUNTIME_LOG_SOURCE
Expand Down

0 comments on commit 17e1148

Please sign in to comment.