Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

fix: make TablesClient.predict permissive to input data types #13

Merged
merged 4 commits into from Mar 23, 2020

Commits on Feb 18, 2020

  1. fix: make TablesClient.predict permissive to input data types

    The current implementation checks input instance's data type according
    to column spec's data type. E.g., if the column spec is float, it
    requires the input to be float or int, but not string. However, this
    is not the same as tables API contract:
    
       float column data type could be string or number values.
    
    The current code raises exception with error messages like
    
        TypeError: '0' has type str, but expected one of: int, long, float
        when passed in a string value for numeric columns, which should be
        allowed.
    
    This PR changes the logic so that Python SDK side will be permissive
    for the input data type - basically all JSON compatible data types are
    allow. And rely on backend for the validation.
    Helin Wang committed Feb 18, 2020
    Copy the full SHA
    a2f069b View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2020

  1. Fix according to comment.

    Helin Wang committed Feb 19, 2020
    Copy the full SHA
    5a65463 View commit details
    Browse the repository at this point in the history
  2. Fix lint.

    Helin Wang committed Feb 19, 2020
    Copy the full SHA
    10ecc3a View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2020

  1. Address comment: use elif instead of if

    Helin Wang committed Mar 12, 2020
    Copy the full SHA
    06f5795 View commit details
    Browse the repository at this point in the history