sagemaker-python-sdk icon indicating copy to clipboard operation
sagemaker-python-sdk copied to clipboard

Model.is_repack should return a bool but sometimes returns a None

Open lendle opened this issue 1 year ago • 0 comments

Describe the bug is_repack is implemented as return self.source_dir and self.entry_point and not self.git_config and the return type hint is bool. If source_dir or entry_point is None, is_repack will return None for example.

To reproduce

from sagemaker import Model

assert isinstance(Model().is_repack(), bool) #this fails

Expected behavior is_repack returns a bool, as the type hint suggests.

Screenshots or logs If applicable, add screenshots or logs to help explain your problem.

System information A description of your system. Please provide:

  • SageMaker Python SDK version: I noticed this in 2.228.0, but it appears to still be the case in master.
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): NA
  • Framework version:NA
  • Python version: 3.10.6
  • CPU or GPU: NA
  • Custom Docker image (Y/N): N

Additional context

Maybe return self.source_dir is not None and self.entry_point is not None and self.git_config is None? Not sure if falsey empty strings/dicts should be treated as true or false.

lendle avatar Aug 14 '24 01:08 lendle