VorTECHsa / python-sdk

Vortexa DataScience SDK
https://vortechsa.github.io/python-sdk/
Apache License 2.0
21 stars 9 forks source link

Encode URLS correctly #64

Closed KitBurgess closed 4 years ago

KitBurgess commented 4 years ago

https://kite.com/python/docs/urllib.parse.urlencode

KitBurgess commented 4 years ago

@ChloeConnor do you have the URL you used?

ChloeBellm commented 4 years ago

it may or may not be a result of this code:

from vortexasdk import CargoMovements
from vortexasdk import Vessels
from vortexasdk import Corporations

cargo_movements = CargoMovements()\
    .search(filter_activity='loading_state',
            filter_time_min='2019-11-01T00:00:00.000Z',
            filter_time_max='2019-11-02T00:00:00.000Z')\
    .to_df(columns=['cargo_movement_id', 'product.grade.label', 'product.group.label', 'vessels.0.vessel_class', 'vessels.0.id'])

vessels_in_cms = cargo_movements["vessels.0.id"].tolist()

vessel_details = Vessels().search(ids=vessels_in_cms).to_df(
    columns=['id', 'name', 'imo', 'mmsi', 'related_names', 'corporate_entities'])

print(str(len(vessel_details)) + " vessels found")

print(vessel_details)

cms_with_vessel = cargo_movements.merge(
    vessel_details, left_on='vessels.0.id', right_on='id')[['id', 'cargo_movement_id']]

how_many_per_vessel = cms_with_vessel.groupby(
    by=['id']).count().sort_values(by='cargo_movement_id', ascending=False)

print(how_many_per_vessel)

vessel_owners = vessel_details['corporate_entities']

print(vessel_owners[0])
KitBurgess commented 4 years ago

I haven't been able to reproduce this issue yet.

KitBurgess commented 4 years ago

@all-contributors add @ChloeConnor for userTesting

allcontributors[bot] commented 4 years ago

@KitBurgess

I've put up a pull request to add @ChloeConnor! :tada:

KitBurgess commented 4 years ago

Closing as unreproducible, and this problem hasn't come up again.