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

New line causes ValidationException (potential race condition)

Open l1x opened this issue 3 years ago • 0 comments

Describe the bug

The following code results in an exception:

fg = FeatureGroup(
    name="hello", sagemaker_session=feature_store_session
)
fg.put_record([
    FeatureValue('id', '2'),
    FeatureValue('data', 'test\n'),
    FeatureValue('EventTime', '0.0')
])

The exception:

ClientError: An error occurred (ValidationException) when calling the PutRecord operation: 1 validation error detected: Value 'test
' at 'record.2.member.valueAsString' failed to satisfy constraint: Member must satisfy regular expression pattern: .*

To reproduce

See above.

Expected behavior

Probably have an exception saying new line characters are not allowed instead of saying a regexp check failed.

System information A description of your system. Please provide:

  • SageMaker Python SDK version: 2.100.0
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): NA
  • Framework version: NA
  • Python version: 3.10.5
  • CPU or GPU: CPU
  • Custom Docker image (Y/N): N

l1x avatar Aug 12 '22 08:08 l1x