()
| 940 | |
| 941 | |
| 942 | def test_twoclass_method2(): |
| 943 | # Same as test_twoclass_method but now the common table is shared |
| 944 | ( |
| 945 | foo_transformer, |
| 946 | transformer2, |
| 947 | transformer_common, |
| 948 | ) = _fixture_twoclass_transformers() |
| 949 | |
| 950 | hypers = T( |
| 951 | """ |
| 952 | | a |
| 953 | 11 | 1 |
| 954 | 12 | 2 |
| 955 | """ |
| 956 | ) |
| 957 | table = T( |
| 958 | """ |
| 959 | | a1 | h1 | a2 | h2 | ac | hc |
| 960 | 6 | 1 | 11 | 1 | 13 | 1 | 14 |
| 961 | 7 | 2 | 11 | 2 | 13 | 2 | 14 |
| 962 | 8 | 3 | 12 | 3 | 13 | 3 | 14 |
| 963 | """ |
| 964 | ).with_columns( |
| 965 | h1=hypers.pointer_from(this.h1), |
| 966 | h2=hypers.pointer_from(this.h2), |
| 967 | hc=hypers.pointer_from(this.hc), |
| 968 | ) |
| 969 | |
| 970 | method_table: Table = foo_transformer( |
| 971 | hypers=hypers, table=table.select(a=table.a1, h=table.h1) |
| 972 | ).table |
| 973 | assert_table_equality( |
| 974 | method_table.select(b=method_table.b, c=method_table.c(1000)), |
| 975 | T( |
| 976 | """ |
| 977 | | b | c |
| 978 | 6 | 11 | 12000 |
| 979 | 7 | 21 | 23000 |
| 980 | 8 | 32 | 35000 |
| 981 | """ |
| 982 | ), |
| 983 | ) |
| 984 | |
| 985 | hypers2 = T( |
| 986 | """ |
| 987 | | a |
| 988 | 13 | 3 |
| 989 | """ |
| 990 | ) |
| 991 | |
| 992 | method_table2: Table = transformer2( |
| 993 | hypers=hypers2, table=table.select(a=table.a2, h=table.h2) |
| 994 | ).table |
| 995 | assert_table_equality( |
| 996 | method_table2.select(b=method_table2.b, c=method_table2.c(1000000)), |
| 997 | T( |
| 998 | """ |
| 999 | | b | c |
nothing calls this directly
no test coverage detected