MCPcopy Index your code
hub / github.com/plotly/dash / generate_mock_data_with_date

Function generate_mock_data_with_date

components/dash-table/tests/selenium/utils.py:216–238  ·  view source on GitHub ↗
(rows=100)

Source from the content-addressed store, hash-verified

214
215
216def generate_mock_data_with_date(rows=100):
217 props = generate_mock_data(rows)
218
219 for c in props["columns"]:
220 if c["id"] == "ccc":
221 c.update(
222 dict(
223 name=["Date", "only"],
224 type="datetime",
225 validation=dict(allow_YY=True),
226 )
227 )
228 elif c["id"] == "ddd":
229 c.update(dict(name=["Date", "with", "time"], type="datetime"))
230
231 for i in range(len(props["data"])):
232 d = props["data"][i]
233 d["ccc"] = (date(2018, 1, 1) + timedelta(days=3 * i)).strftime("%Y-%m-%d")
234 d["ddd"] = (date(2018, 1, 1) + timedelta(seconds=7211 * i)).strftime(
235 "%Y-%m-%d %H:%M:%S"
236 )
237
238 return props
239
240
241def get_props(rows=100, data_fn=generate_mock_data):

Callers

nothing calls this directly

Calls 2

generate_mock_dataFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…