pathwaycom / pathway

Python ETL framework for stream processing, real-time analytics, LLM pipelines, and RAG.
https://pathway.com
Other
2.84k stars 98 forks source link

[Bug]: Json type does not behave like a transparent wrapper for the value #38

Closed izulin closed 2 months ago

izulin commented 2 months ago

Steps to reproduce

when passing Json unpacked float values to geopy distance function, I received a following error:

    return distance.distance([lat, lon], [lat2, lon2]).meters
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/przemek/miniconda3/envs/202306-pathway/lib/python3.11/site-packages/geopy/distance.py", line 540, in __init__
    super().__init__(*args, **kwargs)
  File "/home/przemek/miniconda3/envs/202306-pathway/lib/python3.11/site-packages/geopy/distance.py", line 276, in __init__
    kilometers += self.measure(a, b)
                  ^^^^^^^^^^^^^^^^^^
  File "/home/przemek/miniconda3/envs/202306-pathway/lib/python3.11/site-packages/geopy/distance.py", line 556, in measure
    a, b = Point(a), Point(b)
           ^^^^^^^^
  File "/home/przemek/miniconda3/envs/202306-pathway/lib/python3.11/site-packages/geopy/point.py", line 175, in __new__
    return cls.from_sequence(seq)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/przemek/miniconda3/envs/202306-pathway/lib/python3.11/site-packages/geopy/point.py", line 472, in from_sequence
    return cls(*args)
           ^^^^^^^^^^
  File "/home/przemek/miniconda3/envs/202306-pathway/lib/python3.11/site-packages/geopy/point.py", line 188, in __new__
    _normalize_coordinates(latitude, longitude, altitude)
  File "/home/przemek/miniconda3/envs/202306-pathway/lib/python3.11/site-packages/geopy/point.py", line 57, in _normalize_coordinates
    latitude = float(latitude or 0.0)
               ^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'Json'

Relevant log output

-

What did you expect to happen?

Json unpacked float to be a transparent wrapper for float value

Version

0.8.0

Docker Versions (if used)

No response

OS

Linux

On which CPU architecture did you run Pathway?

None

izulin commented 2 months ago

should be fixed in 0.9.0