Classes¶
spark_expectations.sinks.utils.writer.SparkExpectationsWriter
dataclass
¶
This class implements/supports writing data into the sink system
Functions¶
generate_rules_exceeds_threshold(rules: dict) -> None
¶
This function implements/supports summarizing row dq error threshold Args: rules: accepts rule metadata within dict Returns: None
Source code in spark_expectations/sinks/utils/writer.py
generate_summarized_row_dq_res(df: DataFrame, rule_type: str) -> None
¶
This function implements/supports summarizing row dq error result Args: df: error dataframe(DataFrame) rule_type: type of the rule(str)
Returns:
Type | Description |
---|---|
None
|
None |
Source code in spark_expectations/sinks/utils/writer.py
942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 |
|
get_row_dq_detailed_stats() -> List[Tuple[str, str, str, str, str, str, str, str, str, None, None, int, str, int, str, str]]
¶
This function writes the detailed stats for row dq into the detailed stats table
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
Provide the dataframe which need to be written as a table |
required | |
rule_type |
Provide the rule type for which the detailed stats need to be written |
required |
Returns:
Type | Description |
---|---|
List[Tuple[str, str, str, str, str, str, str, str, str, None, None, int, str, int, str, str]]
|
List[]: List of tuples which consist of detailed stats for row dq |
Source code in spark_expectations/sinks/utils/writer.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
|
save_df_as_table(df: DataFrame, table_name: str, config: dict, stats_table: bool = False) -> None
¶
This function takes a dataframe and writes into a table
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
Provide the dataframe which need to be written as a table |
required |
table_name |
str
|
Provide the table name to which the dataframe need to be written to |
required |
config |
dict
|
Provide the config to write the dataframe into the table |
required |
stats_table |
bool
|
Provide if this is for writing stats table |
False
|
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
|
Source code in spark_expectations/sinks/utils/writer.py
write_detailed_stats() -> None
¶
This functions writes the detailed stats for all rule type into the detailed stats table
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
Provide the config to write the dataframe into the table |
required |
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
|
Source code in spark_expectations/sinks/utils/writer.py
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 |
|
write_error_records_final(df: DataFrame, error_table: str, rule_type: str) -> Tuple[int, DataFrame]
¶
Source code in spark_expectations/sinks/utils/writer.py
write_error_stats() -> None
¶
This functions takes the stats table and write it into error table
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
Provide the config to write the dataframe into the table |
required |
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
|
Source code in spark_expectations/sinks/utils/writer.py
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 |
|