(rows=100)
| 214 | |
| 215 | |
| 216 | def 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 | |
| 241 | def get_props(rows=100, data_fn=generate_mock_data): |
nothing calls this directly
no test coverage detected
searching dependent graphs…