Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit TimeType subtraction #51743

Merged
merged 3 commits into from
Oct 18, 2023
Merged

Conversation

JeffBezanson
Copy link
Member

Implements the plan approved by triage. Replaces #49805.

@JeffBezanson JeffBezanson added the backport 1.10 Change should be backported to the 1.10 release label Oct 17, 2023
@JeffBezanson JeffBezanson added this to the 1.10 milestone Oct 17, 2023
@JeffBezanson JeffBezanson merged commit 8a889ff into master Oct 18, 2023
@JeffBezanson JeffBezanson deleted the jb/baumgold-DateTime_subtraction branch October 18, 2023 20:32
KristofferC pushed a commit that referenced this pull request Oct 23, 2023
Disallow some type combinations that don't make sense.

---------

Co-authored-by: Ben Baumgold <[email protected]>
(cherry picked from commit 8a889ff)
@KristofferC
Copy link
Member

KristofferC commented Oct 24, 2023

Isn't this a bit breaking? From PkgEval on backport branch:

Error During Test at /home/pkgeval/.julia/packages/MonthlyDates/dqXkG/test/runtests.jl:75
  Test threw exception
  Expression: MonthlyDate(1990, 1) - MonthlyDate(1989, 1) == Month(12)
  MethodError: no method matching -(::MonthlyDate, ::MonthlyDate)
     accessors: Error During Test at /home/pkgeval/.julia/packages/Intervals/V53WF/test/interval.jl:128
  Test threw exception
  Expression: span(interval) == b - a
  MethodError: no method matching -(::InfExtendedTime{Date}, ::InfExtendedTime{Date})
Test threw exception
Expression: !(l1 in dr)
MethodError: no method matching -(::QDates.QDate, ::QDates.QDate)

Closest candidates are:
  -(::QDates.QDate, !Matched::Dates.CompoundPeriod)
    @ QDates ~/.julia/packages/QDates/Zu2GK/src/periods.jl:14
  -(::QDates.QDate, !Matched::Dates.Year)
  Testing Running tests...
  arithmetic: Error During Test at /home/pkgeval/.julia/packages/UnixTimes/pJJGK/test/runtests.jl:63
    Test threw exception
    Expression: UnixTime(2020, 1, 1, 10) - UnixTime(2020, 1, 1, 9) == Nanosecond(60 * 60 * 1000000000)
    StackOverflowError:
    Stacktrace:
      [1] -(x::UnixTime, y::UnixTime) (repeats 79984 times)
        @ Dates /opt/julia/share/julia/stdlib/v1.10/Dates/src/arithmetic.jl:12
     Testing Running tests...
ERROR: LoadError: MethodError: no method matching -(::SemesterDate, ::SemesterDate)

Closest candidates are:
  -(::SemesterDate, !Matched::Year)
   @ ExtendedDates ~/.julia/packages/ExtendedDates/ibFpe/src/arithmetic.jl:23
  -(::SemesterDate, !Matched::Semester)
   @ ExtendedDates ~/.julia/packages/ExtendedDates/ibFpe/src/arithmetic.jl:35

JeffBezanson added a commit that referenced this pull request Oct 26, 2023
Restores the method whose removal was probably causing problems.
JeffBezanson added a commit that referenced this pull request Oct 26, 2023
Restores the method whose removal was probably causing problems.

(cherry picked from commit 14d9c7c)
JeffBezanson added a commit that referenced this pull request Oct 26, 2023
Restores the method whose removal was probably causing problems.
KristofferC pushed a commit that referenced this pull request Oct 30, 2023
Restores the method whose removal was probably causing problems.

(cherry picked from commit f6f1ee9)
KristofferC pushed a commit that referenced this pull request Oct 31, 2023
Restores the method whose removal was probably causing problems.
@KristofferC KristofferC removed the backport 1.10 Change should be backported to the 1.10 release label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants