Commit a4899cb
authored
Add ignore_transactions config to disable transaction operations (#711)
Introduces a new `ignore_transactions` configuration parameter (default: True)
to control transaction-related behavior in the Connection class.
When ignore_transactions=True (default):
- commit(): no-op, returns immediately
- rollback(): raises NotSupportedError with message "Transactions are not supported on Databricks"
- autocommit setter: no-op, returns immediately
When ignore_transactions=False:
- All transaction methods execute normally
Changes:
- Added ignore_transactions parameter to Connection.__init__() with default value True
- Modified commit(), rollback(), and autocommit setter to check ignore_transactions flag
- Updated unit tests to pass ignore_transactions=False when testing transaction functionality
- Updated e2e transaction tests to pass ignore_transactions=False
- Added three new unit tests to verify ignore_transactions1 parent cca421b commit a4899cb
File tree
3 files changed
+131
-5
lines changed- src/databricks/sql
- tests
- e2e
- unit
3 files changed
+131
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
220 | 227 | | |
221 | 228 | | |
222 | 229 | | |
| |||
318 | 325 | | |
319 | 326 | | |
320 | 327 | | |
| 328 | + | |
321 | 329 | | |
322 | 330 | | |
323 | 331 | | |
| |||
556 | 564 | | |
557 | 565 | | |
558 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
559 | 570 | | |
560 | 571 | | |
561 | 572 | | |
562 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
563 | 578 | | |
564 | 579 | | |
565 | 580 | | |
| |||
651 | 666 | | |
652 | 667 | | |
653 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
654 | 672 | | |
655 | 673 | | |
656 | 674 | | |
657 | 675 | | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
658 | 680 | | |
659 | 681 | | |
660 | 682 | | |
| |||
689 | 711 | | |
690 | 712 | | |
691 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
692 | 717 | | |
693 | 718 | | |
694 | 719 | | |
695 | 720 | | |
| 721 | + | |
696 | 722 | | |
697 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
698 | 731 | | |
699 | 732 | | |
700 | 733 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
658 | | - | |
659 | | - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
660 | 662 | | |
661 | 663 | | |
662 | 664 | | |
| |||
928 | 930 | | |
929 | 931 | | |
930 | 932 | | |
931 | | - | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
932 | 936 | | |
933 | 937 | | |
934 | 938 | | |
| |||
958 | 962 | | |
959 | 963 | | |
960 | 964 | | |
961 | | - | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
962 | 968 | | |
963 | 969 | | |
964 | 970 | | |
| |||
983 | 989 | | |
984 | 990 | | |
985 | 991 | | |
986 | | - | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
987 | 995 | | |
988 | 996 | | |
989 | 997 | | |
| |||
998 | 1006 | | |
999 | 1007 | | |
1000 | 1008 | | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1001 | 1093 | | |
1002 | 1094 | | |
1003 | 1095 | | |
| |||
0 commit comments