wrangleworks / WranglesPY

Wrangles python package
https://wrangles.io/python
Apache License 2.0
3 stars 1 forks source link

Extract.Attributes - Inconsistent Attribute Types #195

Closed ebhills closed 1 year ago

ebhills commented 1 year ago

When using extract.attributes, some of those listed in our docs don't work and others are missing from wrangles.io.

For example 'charge' and 'luminous flux' are found in this description but can't be accessed directly.

Example:

The MILWAUKEE® REDLITHIUM™ USB Hard Hat Headlamp is 20% LIGHTER WEIGHT, BRIGHTER, and offers MORE RUNTIME. This high output, compact headlamp is all powered by the REDLITHIUM USB Battery. This rechargeable headlamp is a lightweight and compact design that delivers 600 lumens of TRUEVIEW™ HIGH-DEFINITION OUTPUT with hybrid, spot, and flood modes. The headlamp easily detaches from the bracket for easy charging and to help get light into those hard-to-reach places. You can now optimize the position of the light with 180 degrees of mobility and 5 different output modes. This headlamp is IP54 rated as weather and dust resistant and survives impacts from up to 2 meters to withstand harsh job site conditions. The REDLITHIUM™ USB Hard Hat Headlamp is powered by the REDLITHIUM™ USB 3.0AH Battery, providing all-day run-time, more recharges, and 3x faster charge time. The REDLITHIUM™ USB Battery can be recharged in the flashlight via USB - C or swapped out with additional REDLITHIUM™ USB Batteries for virtually no downtime. The REDLITHIUM™ USB Hard Hat Headlamp is covered by a limited lifetime warranty.

ChrisWRWX commented 1 year ago

@cerdamario13 Please remove this from extract.py:

    # Check that attribute_type is correct
    attributes_type_list = ["angle","area","current","force","length","power","pressure","electric potential","volume","mass"]
    if type != None and type.lower() not in attributes_type_list: raise ValueError(f'"{type}" is not a valid attribute_type value.')

The server side code should validate that the inputs are acceptable and send back appropriate errors. The client side code should deal with the status responses that the server sends back.

ChrisWRWX commented 1 year ago

@thomasstvr Please check this is consistent for the schema and wrangles.io

We probably don't want a full list as some are very obscure, but we should allow all to pass through. I'll check in with you to discuss finding any omitted.

thomasstvr commented 1 year ago

Website and schema have been updated.