@@ -628,19 +628,13 @@ with_ordered_restart <- function(expr, .call) {
628
628
class_y <- class(y )[1 ]
629
629
630
630
restart <- FALSE
631
- warn <- TRUE
632
- two_ordered <- FALSE
633
631
634
632
if (is.ordered(x ) || is.ordered(y )) {
635
633
restart <- TRUE
636
- x_is_ordered <- is.ordered(x )
637
- y_is_ordered <- is.ordered(y )
638
- # Check whether vec_cast should emit warning
639
- two_ordered <- x_is_ordered && y_is_ordered
640
- if (x_is_ordered ) {
634
+ if (is.ordered(x )) {
641
635
x <- factor (as.character(x ), levels = levels(x ))
642
636
}
643
- if (y_is_ordered ) {
637
+ if (is.ordered( y ) ) {
644
638
y <- factor (as.character(y ), levels = levels(y ))
645
639
}
646
640
} else if (is.character(x ) || is.character(y )) {
@@ -674,11 +668,8 @@ with_ordered_restart <- function(expr, .call) {
674
668
format_error_call(.call ),
675
669
" )"
676
670
)
677
- if (inherits(cnd , " vctrs_error_cast" )) {
678
- # Should be FALSE when vec_ptype2 has seen two ordered factors
679
- warn <- attr(y , " warn" ) %|| % TRUE
680
- }
681
- if (warn ) {
671
+
672
+ if (inherits(cnd , " vctrs_error_ptype2" )) {
682
673
deprecate_soft0(
683
674
" 3.4.0" ,
684
675
I(msg ),
@@ -693,8 +684,6 @@ with_ordered_restart <- function(expr, .call) {
693
684
# Recurse with factor methods and restart with the result
694
685
if (inherits(cnd , " vctrs_error_ptype2" )) {
695
686
out <- vec_ptype2(x , y , x_arg = x_arg , y_arg = y_arg , call = call )
696
- # Set warn attribute to forward to vec_cast
697
- attr(out , " warn" ) <- ! two_ordered
698
687
restart <- " vctrs_restart_ptype2"
699
688
} else if (inherits(cnd , " vctrs_error_cast" )) {
700
689
out <- vec_cast(x , y , x_arg = x_arg , to_arg = y_arg , call = call )
0 commit comments