jannikmi / timezonefinder

python package for finding the timezone of any point on earth (coordinates) offline
https://timezonefinder.michelfe.it/
MIT License
461 stars 50 forks source link

RuntimeError: cannot cache function 'inside_polygon' #206

Closed sureskn3 closed 1 year ago

sureskn3 commented 1 year ago

Hi, I am facing error when using timezonfinder packages in spark code. I have spark cluster using python 3.6 package and spark 2.4.8. I am using this package thru UDF code. This code with package was working on the first run and then for subsequent runs , I am facing with below error.

python: python3.6 version used: 5.2.0

_1430_01_000004/udf_time_zone_util.py", line 14, in from timezonefinder import TimezoneFinder File "/opt/anaconda3/lib/python3.6/site-packages/timezonefinder/init.py", line 2, in from timezonefinder.timezonefinder import TimezoneFinder, TimezoneFinderL File "/opt/anaconda3/lib/python3.6/site-packages/timezonefinder/timezonefinder.py", line 53, in from timezonefinder.helpers_numba import ( File "/opt/anaconda3/lib/python3.6/site-packages/timezonefinder/helpers_numba.py", line 29, in @njit(b1(i4, i4, i4[:, :]), cache=True) File "/opt/anaconda3/lib/python3.6/site-packages/numba/decorators.py", line 169, in wrapper disp.enable_caching() File "/opt/anaconda3/lib/python3.6/site-packages/numba/dispatcher.py", line 446, in enable_caching self._cache = FunctionCache(self.py_func) File "/opt/anaconda3/lib/python3.6/site-packages/numba/caching.py", line 306, in init "for file %r" % (qualname, self._source_path)) RuntimeError: cannot cache function 'inside_polygon': no locator available for file '/opt/anaconda3/lib/python3.6/site-packages/timezonefinder/helpers_numba.py'

jannikmi commented 1 year ago

As this error is coming from Numba code, could you please search for an answer in their repository and in case open the issue there.

Make sure to reference this issue so the two issues get linked.

Thank you

sureskn3 commented 1 year ago

Hey, Thanks, I'll do that. Meanwhile can I disable caching for all the functions inside helpers_numba.py. Will it cause issue and will it impact performance in runtime.