Skip to content

Instantly share code, notes, and snippets.

View ddfont's full-sized avatar

Victor Defontnouvelle ddfont

View GitHub Profile
(.venv) bash-3.2$ make pip-compile
pip-compile --verbose --generate-hashes --no-emit-index-url --allow-unsafe --output-file=requirements/prod.txt requirements/prod.in
Using pip-tools configuration defaults found in 'pyproject.toml'.
Using indexes:
https://pypi.org/simple
ROUND 1
ERROR: Cannot install martech==0.4.123 because these package versions have conflicting dependencies.
The conflict is caused by:
12:28:26.327 production /fluentd/kube.supply-planning-service.logistics {"_obs_.log.size":34,"message":"Traceback (most recent call last):","time":"2024-07-19T19:28:26.327540095Z"}
12:28:26.327 production /fluentd/kube.supply-planning-service.logistics {"_obs_.log.size":49,"message":" File \"/home/app/./app/main.py\", line 62, in run","time":"2024-07-19T19:28:26.327543113Z"}
12:28:26.327 production /fluentd/kube.supply-planning-service.logistics {"_obs_.log.size":77,"message":" _log_scenario_service(scenario_id, pb.SIMULATION_STATUS_REQUEST_RECEIVED)","time":"2024-07-19T19:28:26.327546073Z"}
12:28:26.327 production /fluentd/kube.supply-planning-service.logistics {"_obs_.log.size":67,"message":" File \"/home/app/./app/main.py\", line 33, in _log_scenario_service","time":"2024-07-19T19:28:26.327548988Z"}
12:28:26.327 production /fluentd/kube.supply-planning-service.logistics {"_obs_.log.size":58,"message":" return ScenarioService.UpdateScenarioSimulationStatus(","time":"2024-07-19T19:28:26.327551797Z"}
df["last_horizon"] = df["last_horizon"].astype(int)
File "/Users/victor.d/Projects/supply-planning-service/.venv/lib/python3.8/site-packages/pandas/core/generic.py", line 6240, in astype
new_data = self._mgr.astype(dtype=dtype, copy=copy, errors=errors)
File "/Users/victor.d/Projects/supply-planning-service/.venv/lib/python3.8/site-packages/pandas/core/internals/managers.py", line 448, in astype
return self.apply("astype", dtype=dtype, copy=copy, errors=errors)
File "/Users/victor.d/Projects/supply-planning-service/.venv/lib/python3.8/site-packages/pandas/core/internals/managers.py", line 352, in apply
applied = getattr(b, f)(**kwargs)
File "/Users/victor.d/Projects/supply-planning-service/.venv/lib/python3.8/site-packages/pandas/core/internals/blocks.py", line 526, in astype
new_values = astype_array_safe(values, dtype, copy=copy, errors=errors)
File "/Users/victor.d/Projects/supply-planning-service/.venv/lib/python3.8/site-packages/pandas/core/dtypes/astype.py", line 299, in as
(.venv) (base) victor.d@H457W9NM4K supply-planning-service % python3 tests/integration_test.py
Unable to find secrets file at path: /vault/secrets/secrets.json
Unable to read secret ENVIRONMENT loaded from file, falling back to the environment
Unable to read secret NUM_THREADS loaded from file, falling back to the environment
Unable to read secret KAFKA_TOPIC loaded from file, falling back to the environment
Unable to read secret KAFKA_USERNAME loaded from file, falling back to the environment
Unable to read secret KAFKA_PASSWORD loaded from file, falling back to the environment
Unable to read secret DV_API_KEY loaded from file, falling back to the environment
2024-07-16 12:42.50 [info ] Running scenario 980397706883465218 2024-07-15/980397706883465218/adjustments.csv None None
2024-07-16 12:42.50 [info ] Reading from s3: 2024-07-15/base_inputs.pkl
(.venv) (base) victor.d@H457W9NM4K supply-planning-service % make integration-test
uvicorn app.main:app --port 8080 --reload & sleep 5 && curl "http://127.0.0.1:8080/api/run_scenario?scenario_id=980397706883465218&s3_file_url=2024-07-15/980397706883465218/adjustments.csv"
INFO: Will watch for changes in these directories: ['/Users/victor.d/Projects/supply-planning-service']
INFO: Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
INFO: Started reloader process [60593] using statreload
Unable to find secrets file at path: /vault/secrets/secrets.json
Unable to read secret ENVIRONMENT loaded from file, falling back to the environment
Unable to read secret NUM_THREADS loaded from file, falling back to the environment
Unable to read secret KAFKA_TOPIC loaded from file, falling back to the environment
Unable to read secret KAFKA_USERNAME loaded from file, falling back to the environment
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.read_csv("data.csv")
df.columns = [c.lower() for c in df.columns]
df = df[["period", "result", "starting_point_id", "online_hours", "undersupply_hours_pct", "oversupply_hours_pct",
"is_late20min", "nd", "num_delivs"]]
df = df.rename(columns={
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.read_csv("data.csv")
df.columns = [c.lower() for c in df.columns]
df = df[["period", "result", "starting_point_id", "online_hours", "undersupply_hours_pct", "oversupply_hours_pct",
"is_late20min", "nd", "num_delivs"]]
df = df.rename(columns={
"result": "group",
> Task :beforeTest
make stop && docker-compose up -d
docker-compose down
time="2024-06-06T16:34:08-07:00" level=warning msg="/Users/victor.d/Projects/dasher-service/services/dasher-service/docker-compose.yml: `version` is obsolete"
Container dasher-service.elasticsearch Stopping
Container dasher-service.crdb Stopping
Container dasher-service.db Stopping
Container dasher-service.redis Stopping
Container dasher-service-cassandra-init-1 Stopping
Container dasher-service-cassandra-init-1 Stopped
{"@timestamp":"2024-04-25T20:39:48.594Z","@version":"1","message":"Error handler for dx_promotion_platform.v1.DasherChallengeService/CreateChallenges returned successful response","logger_name":"com.doordash.asgard.grpc.interceptors.ExceptionInterceptor","thread_name":"blocking_worker-epoll-9-8","level":"WARN","level_value":30000,"trace_id":"dc6380559c30ae422b534dd3615cd73b","trace_flags":"00","span_id":"671635dede87d46e","tenant_id":"prod","status":{"code":"UNKNOWN","description":null,"cause":{"cause":null,"stackTrace":[{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"validateStartTimes","fileName":"DasherChallengeService.kt","lineNumber":162,"nativeMethod":false,"className":"com.doordash.dxpromotionplatform.service.DasherChallengeService"},{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"createChallenges","fileName":"DasherChallengeService.kt","lineNumber":188,"nativeMethod":false,"className":"com.doordash.dxpromotionplatform.service.DasherChallengeS
{
"objects": [
{
"endTime": "2024-04-26T07:00:00Z",
"startTime": "2024-04-25T18:30:00Z",
"isRecommendedDash": false,
"startingPointId": 82,
"vehicleType": {
"id": 1,
"name": "car",