|
96 | 96 | }, |
97 | 97 | { |
98 | 98 | "cell_type": "code", |
99 | | - "execution_count": null, |
| 99 | + "execution_count": 6, |
100 | 100 | "metadata": {}, |
101 | | - "outputs": [], |
| 101 | + "outputs": [ |
| 102 | + { |
| 103 | + "data": { |
| 104 | + "text/plain": [ |
| 105 | + "<whylogs.api.whylabs.session.session.LocalSession at 0x7fe3f463edf0>" |
| 106 | + ] |
| 107 | + }, |
| 108 | + "execution_count": 6, |
| 109 | + "metadata": {}, |
| 110 | + "output_type": "execute_result" |
| 111 | + } |
| 112 | + ], |
102 | 113 | "source": [ |
103 | 114 | "import whylogs as why\n", |
| 115 | + "import os\n", |
104 | 116 | "\n", |
| 117 | + "# Optionally you can override the AWS region that profiles get uploaded to when uploading to WhyLabs\n", |
| 118 | + "# os.environ[\"WHYLABS_UPLOAD_REGION\"] = 'ap-southeast-2'\n", |
105 | 119 | "why.init()" |
106 | 120 | ] |
107 | 121 | }, |
|
142 | 156 | }, |
143 | 157 | { |
144 | 158 | "cell_type": "code", |
145 | | - "execution_count": 3, |
| 159 | + "execution_count": 8, |
146 | 160 | "metadata": {}, |
147 | 161 | "outputs": [ |
148 | 162 | { |
|
283 | 297 | "4 Purchase 39.0 " |
284 | 298 | ] |
285 | 299 | }, |
286 | | - "execution_count": 3, |
| 300 | + "execution_count": 8, |
287 | 301 | "metadata": {}, |
288 | 302 | "output_type": "execute_result" |
289 | 303 | } |
|
315 | 329 | }, |
316 | 330 | { |
317 | 331 | "cell_type": "code", |
318 | | - "execution_count": 4, |
| 332 | + "execution_count": 9, |
319 | 333 | "metadata": {}, |
320 | 334 | "outputs": [], |
321 | 335 | "source": [ |
|
352 | 366 | }, |
353 | 367 | { |
354 | 368 | "cell_type": "code", |
355 | | - "execution_count": 5, |
| 369 | + "execution_count": 12, |
356 | 370 | "metadata": {}, |
357 | 371 | "outputs": [ |
358 | 372 | { |
359 | 373 | "data": { |
360 | 374 | "text/plain": [ |
361 | | - "(True, 'log-f8V2ZqQLLXXlBIwi')" |
| 375 | + "(True, 'log-SluRuCMaglUHtWln')" |
362 | 376 | ] |
363 | 377 | }, |
364 | | - "execution_count": 5, |
| 378 | + "execution_count": 12, |
365 | 379 | "metadata": {}, |
366 | 380 | "output_type": "execute_result" |
367 | 381 | } |
|
371 | 385 | "\n", |
372 | 386 | "# The writer uses the same credentials that you set up in why.init\n", |
373 | 387 | "writer = WhyLabsWriter()\n", |
374 | | - "writer.write(file=profile.view())" |
| 388 | + "writer.write(profile)" |
375 | 389 | ] |
376 | 390 | }, |
377 | 391 | { |
|
402 | 416 | }, |
403 | 417 | { |
404 | 418 | "cell_type": "code", |
405 | | - "execution_count": 6, |
| 419 | + "execution_count": 11, |
406 | 420 | "metadata": {}, |
407 | 421 | "outputs": [ |
408 | 422 | { |
409 | 423 | "data": { |
410 | 424 | "text/plain": [ |
411 | | - "[(True, 'log-F8p8MMkxQ7U6PxjG')]" |
| 425 | + "[(True, 'log-iPA3fD7K3IAXqwZk')]" |
412 | 426 | ] |
413 | 427 | }, |
414 | | - "execution_count": 6, |
| 428 | + "execution_count": 11, |
415 | 429 | "metadata": {}, |
416 | 430 | "output_type": "execute_result" |
417 | 431 | } |
|
468 | 482 | }, |
469 | 483 | { |
470 | 484 | "cell_type": "code", |
471 | | - "execution_count": 7, |
| 485 | + "execution_count": null, |
472 | 486 | "metadata": {}, |
473 | | - "outputs": [ |
474 | | - { |
475 | | - "name": "stdout", |
476 | | - "output_type": "stream", |
477 | | - "text": [ |
478 | | - "Logged profile for 2023-09-08 20:45:08.661221+00:00\n", |
479 | | - "Logged profile for 2023-09-07 20:45:09.714203+00:00\n", |
480 | | - "Logged profile for 2023-09-06 20:45:10.755056+00:00\n", |
481 | | - "Logged profile for 2023-09-05 20:45:11.696173+00:00\n", |
482 | | - "Logged profile for 2023-09-04 20:45:12.807533+00:00\n", |
483 | | - "Logged profile for 2023-09-03 20:45:13.793383+00:00\n", |
484 | | - "Logged profile for 2023-09-02 20:45:14.460016+00:00\n" |
485 | | - ] |
486 | | - } |
487 | | - ], |
| 487 | + "outputs": [], |
488 | 488 | "source": [ |
489 | 489 | "import numpy as np\n", |
490 | 490 | "from datetime import datetime, timedelta\n", |
|
517 | 517 | }, |
518 | 518 | { |
519 | 519 | "cell_type": "code", |
520 | | - "execution_count": 8, |
| 520 | + "execution_count": null, |
521 | 521 | "metadata": {}, |
522 | | - "outputs": [ |
523 | | - { |
524 | | - "name": "stdout", |
525 | | - "output_type": "stream", |
526 | | - "text": [ |
527 | | - "profiling batch: 0 out of 10 batches of data\n" |
528 | | - ] |
529 | | - }, |
530 | | - { |
531 | | - "name": "stderr", |
532 | | - "output_type": "stream", |
533 | | - "text": [ |
534 | | - "trace_id was specified as None but there is already a trace_id defined in metadata[whylabs.traceId]: 717a6394-cef6-46f7-8f0f-38d8cbdfee0b\n", |
535 | | - "trace_id was specified as None but there is already a trace_id defined in metadata[whylabs.traceId]: 717a6394-cef6-46f7-8f0f-38d8cbdfee0b\n" |
536 | | - ] |
537 | | - }, |
538 | | - { |
539 | | - "name": "stdout", |
540 | | - "output_type": "stream", |
541 | | - "text": [ |
542 | | - "profiling batch: 1 out of 10 batches of data\n", |
543 | | - "profiling batch: 2 out of 10 batches of data\n", |
544 | | - "profiling batch: 3 out of 10 batches of data\n" |
545 | | - ] |
546 | | - }, |
547 | | - { |
548 | | - "name": "stderr", |
549 | | - "output_type": "stream", |
550 | | - "text": [ |
551 | | - "trace_id was specified as None but there is already a trace_id defined in metadata[whylabs.traceId]: 717a6394-cef6-46f7-8f0f-38d8cbdfee0b\n", |
552 | | - "trace_id was specified as None but there is already a trace_id defined in metadata[whylabs.traceId]: 717a6394-cef6-46f7-8f0f-38d8cbdfee0b\n", |
553 | | - "trace_id was specified as None but there is already a trace_id defined in metadata[whylabs.traceId]: 717a6394-cef6-46f7-8f0f-38d8cbdfee0b\n", |
554 | | - "trace_id was specified as None but there is already a trace_id defined in metadata[whylabs.traceId]: 717a6394-cef6-46f7-8f0f-38d8cbdfee0b\n", |
555 | | - "trace_id was specified as None but there is already a trace_id defined in metadata[whylabs.traceId]: 717a6394-cef6-46f7-8f0f-38d8cbdfee0b\n" |
556 | | - ] |
557 | | - }, |
558 | | - { |
559 | | - "name": "stdout", |
560 | | - "output_type": "stream", |
561 | | - "text": [ |
562 | | - "profiling batch: 4 out of 10 batches of data\n", |
563 | | - "profiling batch: 5 out of 10 batches of data\n", |
564 | | - "profiling batch: 6 out of 10 batches of data\n", |
565 | | - "profiling batch: 7 out of 10 batches of data\n", |
566 | | - "profiling batch: 8 out of 10 batches of data\n" |
567 | | - ] |
568 | | - }, |
569 | | - { |
570 | | - "name": "stderr", |
571 | | - "output_type": "stream", |
572 | | - "text": [ |
573 | | - "trace_id was specified as None but there is already a trace_id defined in metadata[whylabs.traceId]: 717a6394-cef6-46f7-8f0f-38d8cbdfee0b\n", |
574 | | - "trace_id was specified as None but there is already a trace_id defined in metadata[whylabs.traceId]: 717a6394-cef6-46f7-8f0f-38d8cbdfee0b\n" |
575 | | - ] |
576 | | - }, |
577 | | - { |
578 | | - "name": "stdout", |
579 | | - "output_type": "stream", |
580 | | - "text": [ |
581 | | - "profiling batch: 9 out of 10 batches of data\n" |
582 | | - ] |
583 | | - } |
584 | | - ], |
| 522 | + "outputs": [], |
585 | 523 | "source": [ |
586 | 524 | "import numpy as np\n", |
587 | 525 | "from whylogs.api.writer.whylabs import WhyLabsWriter\n", |
|
622 | 560 | }, |
623 | 561 | { |
624 | 562 | "cell_type": "code", |
625 | | - "execution_count": 9, |
| 563 | + "execution_count": null, |
626 | 564 | "metadata": {}, |
627 | | - "outputs": [ |
628 | | - { |
629 | | - "name": "stderr", |
630 | | - "output_type": "stream", |
631 | | - "text": [ |
632 | | - "WARNING:whylogs.api.writer.whylabs:About to upload a profile with a dataset_timestamp that is in the future: -283.243124961853s old.\n" |
633 | | - ] |
634 | | - }, |
635 | | - { |
636 | | - "name": "stdout", |
637 | | - "output_type": "stream", |
638 | | - "text": [ |
639 | | - "Uploaded with <whylogs.api.writer.whylabs.WhyLabsWriter object at 0x7f001c0a2d60>, profile with timestamp: 2023-09-08 20:50:00+00:00 and filename profile.2023-09-08_13-50.bin\n", |
640 | | - "Uploaded with <whylogs.api.writer.local.LocalWriter object at 0x7f001c0d2280>, profile with timestamp: 2023-09-08 20:50:00+00:00 and filename profile.2023-09-08_13-50.bin\n" |
641 | | - ] |
642 | | - } |
643 | | - ], |
| 565 | + "outputs": [], |
644 | 566 | "source": [ |
645 | 567 | "telemetry_agent.close()" |
646 | 568 | ] |
|
654 | 576 | }, |
655 | 577 | { |
656 | 578 | "cell_type": "code", |
657 | | - "execution_count": 10, |
| 579 | + "execution_count": null, |
658 | 580 | "metadata": {}, |
659 | | - "outputs": [ |
660 | | - { |
661 | | - "name": "stdout", |
662 | | - "output_type": "stream", |
663 | | - "text": [ |
664 | | - "profile.2023-09-08_13-45.bin profile.2023-09-08_13-50.bin\n" |
665 | | - ] |
666 | | - } |
667 | | - ], |
| 581 | + "outputs": [], |
668 | 582 | "source": [ |
669 | 583 | "!ls *.bin" |
670 | 584 | ] |
|
686 | 600 | "name": "python", |
687 | 601 | "nbconvert_exporter": "python", |
688 | 602 | "pygments_lexer": "ipython3", |
689 | | - "version": "3.9.16" |
| 603 | + "version": "3.8.10" |
690 | 604 | }, |
691 | 605 | "orig_nbformat": 4, |
692 | 606 | "vscode": { |
|
0 commit comments