cc-py-commons 0.5.17__tar.gz → 0.5.18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/PKG-INFO +1 -1
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/geolocate.py +35 -21
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons.egg-info/PKG-INFO +1 -1
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/setup.py +1 -1
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/README.md +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/bids/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/bids/bid.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/bids/bid_history.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/bids/bid_history_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/bids/bid_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/carriers/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/carriers/account_carrier_map.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/carriers/account_carrier_map_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/carriers/carrier.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/carriers/carrier_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/carriers/contact.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/carriers/contact_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/config/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/config/c4_account_settings.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/config/env.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/config/mcleod_load_fields.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/config/pc_miler_config.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/db/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/db/connection.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/lanes/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/lanes/carrier_lane.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/lanes/carrier_lane_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/lanes/lane.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/lanes/lane_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/equipment.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/equipment_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/equipment_types.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/freighthub_contact.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/freighthub_contact_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/load.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/load_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/load_status.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/location.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/location_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/map_load_response.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/quotes/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/quotes/quote.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/quotes/quote_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/quotes/quote_status.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/rfp/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/rfp/create_table.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/rfp/rfp_status.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/rfp/truck_lane_search_mapper.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/schemas/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/schemas/camel_case_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/analytics/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/analytics/analytics_event.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/accept_bid.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/cancel_bid.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/constants.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/counter_bid.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/decline_bid.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/get_bid_by_amazon_order_id.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/get_quote.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/get_quote_by_load_id.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/update_bid.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/amazon_session_token.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/constants.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/get_account.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/get_account_settings.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/get_integration.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/get_users_for_account.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/refresh_amazon_token.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/carrier_hub/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/carrier_hub/get_carrier.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/carrier_hub/list_carriers.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/carrier_hub/list_contacts.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/carrier_hub/update_contact.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/freight_hub/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/freight_hub/post_freight_hub_load.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/create_account_folder.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/db/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/db/delete_table.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/get_client.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/get_green_screens_lane_price.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/get_import_stat.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/get_lane_price.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/get_lane_price_for_bulk.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/list_clients.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/post_import_stat.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/update_import_stat.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/slack/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/slack/send_slack_message.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/book_load_notification.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/booking_agent/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/booking_agent/bid_counter_failure_notification.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/booking_agent/constants.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/booking_agent/send_sns_notification.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/booking_assistant_flow_notification.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/import_movements_notification.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/parsed_carrier_notification.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/sns_service.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sqs/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sqs/booking_assistant_flow_event.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sqs/sqs_service.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/tests/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/tests/test_case_conversion.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/tests/test_lambda_utils.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/tests/test_map_transaction.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/tests/test_temperature_utils.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/equipment_clas_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/equipment_class.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/equipment_mapping.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/equipment_mapping_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/map_transaction.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/transaction.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/transaction_schema.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/__init__.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/bulk_lane_price_result_utils.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/case_conversion.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/datadog_logger.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/datetimes.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/dimension_utils.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/geocode_location.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/get_delivery_date.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/json_logger.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/lambda_utils.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/local_file.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/logger.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/logger_v2.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/pc_miler_utils.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/price_utils.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/redis.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/s3_file.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/temperature_utils.py +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons.egg-info/SOURCES.txt +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons.egg-info/dependency_links.txt +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons.egg-info/requires.txt +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons.egg-info/top_level.txt +0 -0
- {cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/setup.cfg +0 -0
@@ -75,29 +75,34 @@ def get_location_with_country(city, state, zipcode, country, logger, reset_cache
|
|
75
75
|
|
76
76
|
return data
|
77
77
|
|
78
|
-
def get_distance(origin_latitude, origin_longitude, destination_latitude, destination_longitude, logger):
|
78
|
+
def get_distance(origin_latitude, origin_longitude, destination_latitude, destination_longitude, logger, with_duration=False):
|
79
79
|
if not origin_latitude or not origin_longitude or \
|
80
80
|
not destination_latitude or not destination_longitude:
|
81
81
|
raise Exception("Calculating distance requires both origin and destination lat/lng")
|
82
82
|
|
83
83
|
from_cache = False
|
84
|
-
pc_miler_can_be_called = False
|
85
84
|
distance_cache_key = __get_distance_cache_key(origin_latitude, origin_longitude, destination_latitude, destination_longitude)
|
86
|
-
|
85
|
+
distance_data_dict = __get_distance_from_cache(distance_cache_key, logger)
|
87
86
|
|
88
|
-
if
|
87
|
+
if distance_data_dict:
|
89
88
|
from_cache = True
|
90
89
|
|
91
|
-
|
92
|
-
|
90
|
+
missing_duration_and_is_required = (with_duration and not distance_data_dict.get('duration'))
|
91
|
+
if not distance_data_dict or missing_duration_and_is_required:
|
92
|
+
distance_data_dict = __get_google_distance(origin_latitude, origin_longitude, destination_latitude, destination_longitude, logger)
|
93
93
|
|
94
|
-
if
|
95
|
-
if not from_cache:
|
96
|
-
__cache_distance(distance_cache_key,
|
94
|
+
if distance_data_dict:
|
95
|
+
if not from_cache or missing_duration_and_is_required:
|
96
|
+
__cache_distance(distance_cache_key, distance_data_dict, logger)
|
97
97
|
else:
|
98
98
|
logger.debug(f"geolocate.get_distance - Google returned no result for {distance_cache_key}")
|
99
99
|
|
100
|
-
|
100
|
+
if distance_data_dict:
|
101
|
+
if with_duration:
|
102
|
+
return distance_data_dict
|
103
|
+
else:
|
104
|
+
return distance_data_dict.get('distance')
|
105
|
+
return None
|
101
106
|
|
102
107
|
def get_timezone(lat,lng, logger):
|
103
108
|
from_cache = False
|
@@ -124,7 +129,7 @@ def get_timezone(lat,lng, logger):
|
|
124
129
|
return timezone
|
125
130
|
|
126
131
|
def __get_google_distance(origin_latitude, origin_longitude, destination_latitude, destination_longitude, logger):
|
127
|
-
|
132
|
+
distance_data = None
|
128
133
|
try:
|
129
134
|
gmaps = googlemaps.Client(key=app_config.GOOGLE_API_KEY)
|
130
135
|
origins = [f'{origin_latitude} {origin_longitude}']
|
@@ -137,10 +142,16 @@ def __get_google_distance(origin_latitude, origin_longitude, destination_latitud
|
|
137
142
|
if response and response['rows'][0]['elements'][0].get('distance', None):
|
138
143
|
distance_in_meters = response['rows'][0]['elements'][0]['distance']['value']
|
139
144
|
distance = distance_in_meters / 1609
|
145
|
+
duration_seconds = response['rows'][0]['elements'][0]['duration']['value']
|
146
|
+
duration_minutes = duration_seconds / 60
|
147
|
+
distance_data = {
|
148
|
+
'distance': distance,
|
149
|
+
'duration': duration_minutes
|
150
|
+
}
|
140
151
|
except Exception as e:
|
141
152
|
logger.error("geolocate.__get_google_distance: Error while getting distance from google", e)
|
142
|
-
|
143
|
-
return
|
153
|
+
distance_data = None
|
154
|
+
return distance_data
|
144
155
|
|
145
156
|
def __get_google_location(city, state, zipcode, country, logger):
|
146
157
|
try:
|
@@ -351,19 +362,22 @@ def __get_location_string(city, state, zipcode):
|
|
351
362
|
|
352
363
|
return location_string.lower()
|
353
364
|
|
354
|
-
def __cache_distance(distance_cache_key,
|
355
|
-
distance_db_conn.set(distance_cache_key,
|
365
|
+
def __cache_distance(distance_cache_key, distance_data, logger):
|
366
|
+
distance_db_conn.set(distance_cache_key, str(distance_data))
|
356
367
|
|
357
368
|
def __get_distance_from_cache(distance_cache_key, logger):
|
358
|
-
|
369
|
+
distance_data = {}
|
359
370
|
try:
|
360
|
-
|
361
|
-
if
|
362
|
-
|
371
|
+
cached_data = distance_db_conn.get(distance_cache_key)
|
372
|
+
if cached_data:
|
373
|
+
if 'duration' in str(cached_data):
|
374
|
+
distance_data = literal_eval(cached_data.decode('utf-8'))
|
375
|
+
else:
|
376
|
+
distance_data['distance'] = float(cached_data)
|
363
377
|
except Exception as e:
|
364
378
|
logger.warn("geolocate.__get_distance_from_cache: Error while getting distance from cache", e)
|
365
|
-
|
366
|
-
return
|
379
|
+
distance_data = {}
|
380
|
+
return distance_data
|
367
381
|
|
368
382
|
def __get_distance_cache_key(origin_latitude, origin_longitude, destination_latitude, destination_longitude):
|
369
383
|
return f'{__truncate(origin_latitude)},{__truncate(origin_longitude)}->{__truncate(destination_latitude)},{__truncate(destination_longitude)}'
|
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|
3
3
|
setup(
|
4
4
|
name='cc_py_commons',
|
5
5
|
description='Common code for microservices',
|
6
|
-
version='0.5.
|
6
|
+
version='0.5.18',
|
7
7
|
url='https://github.com/Cargo-Chief/py-commons',
|
8
8
|
author='CargoChief',
|
9
9
|
author_email='engineering@cargochief.com',
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/carriers/account_carrier_map_schema.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/loads/freighthub_contact_schema.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/analytics/analytics_event.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/__init__.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/accept_bid.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/cancel_bid.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/constants.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/counter_bid.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/decline_bid.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/get_quote.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/booking_agent/update_bid.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/amazon_session_token.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/get_account_settings.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/get_users_for_account.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/c4/refresh_amazon_token.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/carrier_hub/__init__.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/carrier_hub/get_carrier.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/carrier_hub/list_carriers.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/carrier_hub/list_contacts.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/carrier_hub/update_contact.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/freight_hub/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/db/delete_table.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/get_import_stat.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/get_lane_price.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/list_clients.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/post_import_stat.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/mercury/update_import_stat.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/services/slack/send_slack_message.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/import_movements_notification.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sns/parsed_carrier_notification.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/sqs/booking_assistant_flow_event.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/equipment_clas_schema.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/equipment_mapping.py
RENAMED
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/equipment_mapping_schema.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/transactions/transaction_schema.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.17 → cc_py_commons-0.5.18}/cc_py_commons/utils/bulk_lane_price_result_utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|