You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 17, 2024. It is now read-only.
Turning on DEBUG logging causes exceptions with the hello-world example.
Expected behavior
More detailed log messages.
Actual behavior
The following error is shown (only first few lines):
Traceback (most recent call last):
File "DefaultSolver.java", line 200, in ai.timefold.solver.core.impl.solver.DefaultSolver.solve
Exception: Java Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/***/.virtualenvs/timefold/lib/python3.11/site-packages/timefold/solver/_solver.py", line 109, in solve
java_solution = self._delegate.solve(java_problem)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ai.timefold.jpyinterpreter.types.errors.ai.timefold.jpyinterpreter.types.errors.AttributeError: ai.timefold.jpyinterpreter.types.errors.AttributeError: object '08:30' does not have attribute 'strftime'
To Reproduce
diff --git a/python/hello-world/src/hello_world/main.py b/python/hello-world/src/hello_world/main.py
index 660f7430..4b60fade 100644
--- a/python/hello-world/src/hello_world/main.py
+++ b/python/hello-world/src/hello_world/main.py
@@ -10,7 +10,7 @@ from .domain import *
from .constraints import define_constraints
Output of java -version:
openjdk version "17.0.11" 2024-04-16
OpenJDK Runtime Environment (build 17.0.11+9-suse-150400.3.42.1-x8664)
OpenJDK 64-Bit Server VM (build 17.0.11+9-suse-150400.3.42.1-x8664, mixed mode, sharing)
Output of uname -a or ver:
Linux think14 5.14.21-150500.55.65-default TimefoldAI/timefold-solver#1 SMP PREEMPT_DYNAMIC Thu May 23 04:57:11 UTC 2024 (a46829d) x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
Caused by the issue this fixes: #101 ; The gist of it is because Python datetime classes are C-Native, we need to implement our own to avoid FFI calls (that is, Python calling Java or Java calling Python). The datetime classes were missing a few methods that deal with formatting. The hello-world and school-timetabling examples used said unimplemented method in their __str__ function. The __str__ function is only called when DEBUG logging or lower is used.
If you modified the __str__ function of Timeslot to not call strftime, no exception would occur.
Describe the bug
Turning on DEBUG logging causes exceptions with the hello-world example.
Expected behavior
More detailed log messages.
Actual behavior
The following error is shown (only first few lines):
Traceback (most recent call last):
File "DefaultSolver.java", line 200, in ai.timefold.solver.core.impl.solver.DefaultSolver.solve
Exception: Java Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/***/.virtualenvs/timefold/lib/python3.11/site-packages/timefold/solver/_solver.py", line 109, in solve
java_solution = self._delegate.solve(java_problem)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ai.timefold.jpyinterpreter.types.errors.ai.timefold.jpyinterpreter.types.errors.AttributeError: ai.timefold.jpyinterpreter.types.errors.AttributeError: object '08:30' does not have attribute 'strftime'
To Reproduce
diff --git a/python/hello-world/src/hello_world/main.py b/python/hello-world/src/hello_world/main.py
index 660f7430..4b60fade 100644
--- a/python/hello-world/src/hello_world/main.py
+++ b/python/hello-world/src/hello_world/main.py
@@ -10,7 +10,7 @@ from .domain import *
from .constraints import define_constraints
-logging.basicConfig(level=logging.INFO)
+logging.basicConfig(level=logging.DEBUG)
LOGGER = logging.getLogger('app')
Environment
Timefold Solver Version or Git ref:
1.11.0b0
Output of
java -version
:openjdk version "17.0.11" 2024-04-16
OpenJDK Runtime Environment (build 17.0.11+9-suse-150400.3.42.1-x8664)
OpenJDK 64-Bit Server VM (build 17.0.11+9-suse-150400.3.42.1-x8664, mixed mode, sharing)
Output of
uname -a
orver
:Linux think14 5.14.21-150500.55.65-default TimefoldAI/timefold-solver#1 SMP PREEMPT_DYNAMIC Thu May 23 04:57:11 UTC 2024 (a46829d) x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: