cornflow-client 1.3.6__tar.gz → 1.3.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. {cornflow_client-1.3.6/cornflow_client.egg-info → cornflow_client-1.3.7}/PKG-INFO +1 -1
  2. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/application.py +2 -0
  3. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/experiment.py +0 -1
  4. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_execution_files.py +39 -0
  5. {cornflow_client-1.3.6 → cornflow_client-1.3.7/cornflow_client.egg-info}/PKG-INFO +1 -1
  6. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/setup.py +1 -1
  7. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/LICENSE +0 -0
  8. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/MANIFEST.in +0 -0
  9. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/README.rst +0 -0
  10. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/__init__.py +0 -0
  11. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/airflow/__init__.py +0 -0
  12. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/airflow/api.py +0 -0
  13. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/airflow/dag_utilities.py +0 -0
  14. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/constants.py +0 -0
  15. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/__init__.py +0 -0
  16. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/instance.py +0 -0
  17. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/instance_solution.py +0 -0
  18. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/read_tools.py +0 -0
  19. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/solution.py +0 -0
  20. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/tools.py +0 -0
  21. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/cornflow_client.py +0 -0
  22. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/__init__.py +0 -0
  23. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/empty_schema.json +0 -0
  24. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/pulp_json_schema.json +0 -0
  25. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/schema_validator.json +0 -0
  26. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/solver_config.json +0 -0
  27. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/vrp_solution_schema.json +0 -0
  28. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/databricks/__init__.py +0 -0
  29. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/databricks/api.py +0 -0
  30. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/raw_cornflow_client.py +0 -0
  31. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/schema/__init__.py +0 -0
  32. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/schema/dictSchema.py +0 -0
  33. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/schema/dict_functions.py +0 -0
  34. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/schema/manager.py +0 -0
  35. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/schema/tools.py +0 -0
  36. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/__init__.py +0 -0
  37. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/const.py +0 -0
  38. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/__init__.py +0 -0
  39. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/data_input_bad.json +0 -0
  40. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/data_schema.json +0 -0
  41. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/endpoints_access.json +0 -0
  42. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/endpoints_methods.json +0 -0
  43. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/gc_input.json +0 -0
  44. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/gc_output.json +0 -0
  45. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/graph_coloring_input.json +0 -0
  46. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/graph_coloring_output.json +0 -0
  47. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/hk_data_input.json +0 -0
  48. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/hk_data_schema.json +0 -0
  49. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/hk_solution_schema.json +0 -0
  50. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/instance-hackathon2.json +0 -0
  51. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/name_problem_schema.json +0 -0
  52. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/pulp_example_data.json +0 -0
  53. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/schema_with_fk.json +0 -0
  54. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/schema_without_fk.json +0 -0
  55. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/test_mps.mps +0 -0
  56. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_with_access.xlsx +0 -0
  57. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_with_fk.xlsx +0 -0
  58. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_with_methods.xlsx +0 -0
  59. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_without_fk.xlsx +0 -0
  60. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/integration/__init__.py +0 -0
  61. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/integration/test_airflow_integration.py +0 -0
  62. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/integration/test_cornflow_integration.py +0 -0
  63. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/integration/test_raw_cornflow_integration.py +0 -0
  64. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/__init__.py +0 -0
  65. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_abc.py +0 -0
  66. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_core.py +0 -0
  67. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_dag_utilities.py +0 -0
  68. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_instance_solution_methods.py +0 -0
  69. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_schema_from_excel.py +0 -0
  70. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_schema_manager.py +0 -0
  71. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_varnames.py +0 -0
  72. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client.egg-info/SOURCES.txt +0 -0
  73. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client.egg-info/dependency_links.txt +0 -0
  74. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client.egg-info/requires.txt +0 -0
  75. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client.egg-info/top_level.txt +0 -0
  76. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/requirements.txt +0 -0
  77. {cornflow_client-1.3.6 → cornflow_client-1.3.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cornflow-client
3
- Version: 1.3.6
3
+ Version: 1.3.7
4
4
  Summary: Client to connect to a cornflow server
5
5
  Home-page: https://github.com/baobabsoluciones/cornflow
6
6
  Author: baobab soluciones
@@ -23,6 +23,7 @@ from cornflow_client.constants import (
23
23
  BadInstance,
24
24
  EXECUTION_FILES_STATUS_NOT_GENERATED,
25
25
  )
26
+
26
27
  from .experiment import ExperimentCore
27
28
 
28
29
  # Imports from internal modules
@@ -311,6 +312,7 @@ class ApplicationCore(ABC):
311
312
  # Perform data checks only if a valid solution dict was obtained
312
313
  # and the solver implements data_checks
313
314
  # Checks for non-None and non-empty dict
315
+ solution_has_errors = False
314
316
  if final_sol_dict:
315
317
  solution_checks, solution_has_errors = self._check_solution_errors(algo)
316
318
 
@@ -278,7 +278,6 @@ class ExperimentCore(CheckCore, ABC):
278
278
  ]:
279
279
  if data is None:
280
280
  continue
281
- data = {k: v for k, v in data.items() if len(v)}
282
281
  if not len(data):
283
282
  continue
284
283
  default_files[f"{excel_name}.xlsx"] = to_excel_memory_file(data)
@@ -5,6 +5,8 @@ import unittest
5
5
  import zipfile
6
6
  from unittest.mock import Mock, patch
7
7
 
8
+ from openpyxl import load_workbook
9
+
8
10
  from cornflow_client import (
9
11
  ApplicationCore,
10
12
  CornFlow,
@@ -267,6 +269,23 @@ class TestExperimentExecutionFiles(unittest.TestCase):
267
269
  self.assertIn("checks.xlsx", names)
268
270
  self.assertIn("solution_checks.xlsx", names)
269
271
 
272
+ def test_get_zip_file_includes_empty_tables_as_sheets(self):
273
+ """
274
+ Validates that empty tables are kept as (empty) sheets in default exports.
275
+ """
276
+ experiment = self._experiment(output_files={})
277
+
278
+ zip_file, status = experiment._get_zip_file({}, False, {}, False)
279
+
280
+ self.assertEqual(EXECUTION_FILES_STATUS_OK, status)
281
+ with zipfile.ZipFile(zip_file) as zf:
282
+ with zf.open("solution.xlsx") as solution_file:
283
+ workbook = load_workbook(io.BytesIO(solution_file.read()))
284
+ # The solution contains "an_empty_table": [], which must still get a sheet.
285
+ self.assertIn("an_empty_table", workbook.sheetnames)
286
+ self.assertEqual(1, workbook["an_empty_table"].max_row)
287
+ self.assertIsNone(workbook["an_empty_table"].cell(row=1, column=1).value)
288
+
270
289
  def test_get_zip_file_includes_default_kpis_file(self):
271
290
  """
272
291
  Validates that KPI data is included as a default Excel export.
@@ -531,5 +550,25 @@ class TestApplicationExecutionFiles(unittest.TestCase):
531
550
  self.assertEqual(EXECUTION_FILES_STATUS_ERROR, result[4])
532
551
 
533
552
 
553
+ def test_validate_and_check_solution_handles_empty_solution(self):
554
+ """
555
+ Validates that a schema-valid but empty solution does not raise and reports
556
+ no solution errors (regression: solution_has_errors was previously unbound).
557
+ """
558
+ instance = ExecutionFilesInstance(self.instance_data)
559
+ # A solution whose schema validates but whose dict is falsy/empty.
560
+ solution = ExecutionFilesSolution({})
561
+ algo = ApplicationExecutionFilesSolver(instance, solution)
562
+
563
+ final_sol_dict, solution_checks, solution_has_errors, kpis = (
564
+ self.app._validate_and_check_solution(algo)
565
+ )
566
+
567
+ self.assertEqual({}, final_sol_dict)
568
+ self.assertFalse(solution_has_errors)
569
+ self.assertIsNone(solution_checks)
570
+ self.assertIsNone(kpis)
571
+
572
+
534
573
  if __name__ == "__main__":
535
574
  unittest.main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cornflow-client
3
- Version: 1.3.6
3
+ Version: 1.3.7
4
4
  Summary: Client to connect to a cornflow server
5
5
  Home-page: https://github.com/baobabsoluciones/cornflow
6
6
  Author: baobab soluciones
@@ -12,7 +12,7 @@ extra_required = {"excel": ["openpyxl", "pandas"]}
12
12
 
13
13
  setuptools.setup(
14
14
  name="cornflow-client",
15
- version="1.3.6",
15
+ version="1.3.7",
16
16
  author="baobab soluciones",
17
17
  author_email="sistemas@baobabsoluciones.es",
18
18
  description="Client to connect to a cornflow server",
File without changes