Bug 151846 - LibreOffice 7.4 missing several imports in com.sun.star.chart2 namespace
Summary: LibreOffice 7.4 missing several imports in com.sun.star.chart2 namespace
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.4.2.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.5.0 target:7.4.4 target:7.6.0
Keywords: bibisected, bisected, regression
: 152732 (view as bug list)
Depends on:
Blocks: UNO
  Show dependency treegraph
 
Reported: 2022-10-31 17:42 UTC by vibrationoflife
Modified: 2023-01-10 18:26 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vibrationoflife 2022-10-31 17:42:12 UTC
LibreOffice 7.4 missing several imports in com.sun.star.chart2 namespace.
Tested on Window 10 and Linux (Ubuntu 22.04)

The following imports all fail on LibreOffice 7.4 and pass on LibreOffice 7.3
>>> from com.sun.star.chart2 import InterpretedData
>>> from com.sun.star.chart2 import XChartTypeTemplate
>>> from com.sun.star.chart2 import XDataInterpreter
>>> from com.sun.star.chart2 import XTransformation

--------------- 7.3 APSO ---------------
APSO python console [LibreOffice]
3.8.10 (default, Sep  2 2022, 19:35:25) 
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]
Type "help", "copyright", "credits" or "license" for more information.
>>> from com.sun.star.chart2 import InterpretedData
>>> from com.sun.star.chart2 import XChartTypeTemplate
>>> from com.sun.star.chart2 import XDataInterpreter
>>> from com.sun.star.chart2 import XTransformation
>>> 

--------------- 7.4 APSO ---------------
APSO python console [LibreOffice]
3.8.14 (default, Oct 10 2022, 14:00:36) 
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from com.sun.star.chart2 import InterpretedData
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/tmp/.mount_LibreOEEYo0d/opt/libreoffice7.4/program/uno.py", line 425, in _uno_import
    raise uno_import_exc
  File "/tmp/.mount_LibreOEEYo0d/opt/libreoffice7.4/program/uno.py", line 346, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
ImportError: No module named 'com' (or 'com.sun.star.chart2.InterpretedData' is unknown)
>>>
>>> from com.sun.star.chart2 import XChartTypeTemplate
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/tmp/.mount_LibreOEEYo0d/opt/libreoffice7.4/program/uno.py", line 425, in _uno_import
    raise uno_import_exc
  File "/tmp/.mount_LibreOEEYo0d/opt/libreoffice7.4/program/uno.py", line 346, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
ImportError: No module named 'com' (or 'com.sun.star.chart2.XChartTypeTemplate' is unknown)
>>> 
>>> from com.sun.star.chart2 import XDataInterpreter
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/tmp/.mount_LibreOEEYo0d/opt/libreoffice7.4/program/uno.py", line 425, in _uno_import
    raise uno_import_exc
  File "/tmp/.mount_LibreOEEYo0d/opt/libreoffice7.4/program/uno.py", line 346, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
ImportError: No module named 'com' (or 'com.sun.star.chart2.XDataInterpreter' is unknown)
>>>
>>> from com.sun.star.chart2 import XTransformation
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/tmp/.mount_LibreOEEYo0d/opt/libreoffice7.4/program/uno.py", line 425, in _uno_import
    raise uno_import_exc
  File "/tmp/.mount_LibreOEEYo0d/opt/libreoffice7.4/program/uno.py", line 346, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
ImportError: No module named 'com' (or 'com.sun.star.chart2.XTransformation' is unknown)


--------------------------------

Post on Ask:
https://ask.libreoffice.org/t/import-failing-what-is-wrong-with-xcharttypetemplate/83428

--------------------------------

Use my OOO UNO TEMPLATE projects test to discover missing interfaces.
https://github.com/Amourspirit/ooo_uno_tmpl/tree/main/tests/test_imports_dyn
Comment 1 Rafael Lima 2022-11-01 13:29:35 UTC
I can confirm the issue:

The following line works in LO 7.3 but does not work in LO 7.4 using APSO.

from com.sun.star.chart2 import InterpretedData

The weird thing is that the similar statement below works both in 7.3 and 7.4.

from com.sun.star.beans import PropertyValue

FTR I'm on Kubuntu 22.04.
Comment 2 Stéphane Guillou (stragu) 2022-11-16 23:19:10 UTC
com.sun.star.chart2 is documented here: https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1chart2.html

It isn't listed as deprecated: https://api.libreoffice.org/docs/idl/ref/deprecated.html

Bisected (only with InterpretedData) to:
 e35e70fd16d24596e16bed1d7b54b3e52827dfd0 is the first bad commit
commit e35e70fd16d24596e16bed1d7b54b3e52827dfd0
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Thu Feb 3 14:32:39 2022 +0100

    source 6b14014342a665268b822729d465e9d3a3a2ca57

Which refers to this commit:

commit 6b14014342a665268b822729d465e9d3a3a2ca57
author	Noel Grandin <noelgrandin@gmail.com>	Tue Feb 01 20:34:49 2022 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	Thu Feb 03 14:26:22 2022 +0100
tree 413d6fe0a442412f2480f0a35c2019b34907a951
parent d4f61a594608219d08b489205ebb5569d905f444

make css::chart2::InterpretedData a normal struct

Noel, could you please have a look?

bisect log:

# bad: [84c8ef56869631d6f245bb03dda89fc864c7b9f0] source 403ff3d3ccba1498568e82e4840a12e53a188406
# good: [36b1ce7e6118699fd36c37261da7f24f935b41ac] source 229123ccc6f90ebf66b3e659bebbd53f8a9bdd3a
git bisect start 'origin/master' 'oldest'
# bad: [ed646e1db031892ffd209a1a5ee0f8e05d584582] source 1e7be382b1f400801d350067e4dfd40d4cfd2db3
git bisect bad ed646e1db031892ffd209a1a5ee0f8e05d584582
# good: [2a98ba333c16f30d2139c16d35fc40123397c691] source 4ab36ed96f9dce18bad751c67bb447d3783f3aba
git bisect good 2a98ba333c16f30d2139c16d35fc40123397c691
# bad: [76102c5398c181e961abb16f1422231b9c27f99a] source 06759801f0a9e8ee80790cf7b8aa02fcb47290a0
git bisect bad 76102c5398c181e961abb16f1422231b9c27f99a
# good: [4ce16bf339c3b5c9d60b15a44d5622cf2f03e622] source 61cb699e88b3680becf78dc7b8bd514b2b7318a4
git bisect good 4ce16bf339c3b5c9d60b15a44d5622cf2f03e622
# bad: [ade99e27e395ab7446f989b84a6a2acd8fd3dc74] source 3a643654bb564c1f8767af1af8dacc9c6c6df41d
git bisect bad ade99e27e395ab7446f989b84a6a2acd8fd3dc74
# good: [9ac7643a186b59c1ab76d6abf147d339e90044ef] source 3b0a0e70cb67fc2e1f9999d2e8cbb9cfcd8c670e
git bisect good 9ac7643a186b59c1ab76d6abf147d339e90044ef
# bad: [f8b89e1238f02e4b6363ed554b9b3613053ef2a4] source d5f015185240a7bddfed7ddf10d6b5426e35fb72
git bisect bad f8b89e1238f02e4b6363ed554b9b3613053ef2a4
# good: [c1d3914410edbac8b7eed4cef6e2c8eb0be59dd4] source 4a38ca4035ac03571925e72cb47e0beb8da2003a
git bisect good c1d3914410edbac8b7eed4cef6e2c8eb0be59dd4
# good: [3b409083bae7da4265942a9c35b34f09c81c9469] source 9aaf8db1e4ac20fce4b19bc43c13b25938e80275
git bisect good 3b409083bae7da4265942a9c35b34f09c81c9469
# bad: [931d82ce72e6abd97f659d4592c6875ed2653560] source 297f000c4968da9a61846d1b336d4fb77e01610c
git bisect bad 931d82ce72e6abd97f659d4592c6875ed2653560
# bad: [e35e70fd16d24596e16bed1d7b54b3e52827dfd0] source 6b14014342a665268b822729d465e9d3a3a2ca57
git bisect bad e35e70fd16d24596e16bed1d7b54b3e52827dfd0
# good: [cb0c1626e6c2a6be84fdd8f0fa837c41abc63e9b] source d4f61a594608219d08b489205ebb5569d905f444
git bisect good cb0c1626e6c2a6be84fdd8f0fa837c41abc63e9b
# first bad commit: [e35e70fd16d24596e16bed1d7b54b3e52827dfd0] source 6b14014342a665268b822729d465e9d3a3a2ca57
Comment 3 Noel Grandin 2022-11-17 05:59:28 UTC
What is your code doing with InterpretedData that it needs to import it?
Comment 4 vibrationoflife 2022-11-17 21:46:50 UTC
(In reply to Noel Grandin from comment #3)
> What is your code doing with InterpretedData that it needs to import it?

I am not useing InterpretedData specifically. I am using XChartTypeTemplate.

These other three I discovered using my OOO UNO TEMPLATE projects that also allows my test to discover missing interfaces and other imports.

https://github.com/Amourspirit/ooo_uno_tmpl/tree/main/tests/test_imports_dyn

- XTransformation
- XDataInterpreter
- InterpretedData


XChartTypeTemplate is critical to my chart2 module (works fine on 7.3x).
https://github.com/Amourspirit/python_ooo_dev_tools/blob/main/ooodev/office/chart2.py
Comment 5 Noel Grandin 2022-11-18 07:49:50 UTC
I can't see any use of 
  - XTransformation 
  - XDataInterpreter
  - InterpretedData
in your code, so it looks like you only actually need XChartTypeTemplate ?
Comment 6 Noel Grandin 2022-11-18 08:59:12 UTC
https://gerrit.libreoffice.org/c/core/+/142908 will restore XChartTypeTemplate.
Comment 7 vibrationoflife 2022-11-18 14:07:00 UTC
(In reply to Noel Grandin from comment #5)
> I can't see any use of 
>   - XTransformation 
>   - XDataInterpreter
>   - InterpretedData
> in your code, so it looks like you only actually need XChartTypeTemplate ?

It is correct that currently I only need XChartTypeTemplate 

As I said, I discovered theese missing in my other project.
They are not missing from 7.3 but are missing from 7.4

  - XTransformation 
  - XDataInterpreter
  - InterpretedData

I am not yet finnished developing https://github.com/Amourspirit/python_ooo_dev_tools
So, I can not be certain these other three missing imports will be an issue later.
Comment 8 Commit Notification 2022-11-19 14:51:35 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ec6502a1f61fcbd4bf05b62f172650fe442c3a1d

tdf#151846 Restore XChartTypeTemplate

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 flywire 2022-11-19 20:41:10 UTC
(In reply to Commit Notification from comment #8)
> Noel Grandin committed a patch related to this issue.
> It has been pushed to "master":

Doesn't look like a Resolved Fix to me. Seems a commit unintentionally broke functionality and dev is only restoring code required for a specific example.
Comment 10 Commit Notification 2022-11-23 12:33:43 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/a7bc3fc2c905619b08c9aa509e85a05ec9376da3

tdf#151846 Restore XChartTypeTemplate

It will be available in 7.4.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 vibrationoflife 2022-11-29 13:35:20 UTC
I just installed the latest daily build of LibreOffice.

I have tested XChartTypeTemplate import and it is working.
My Chart2 Module seems to work fine in this build.

However
The following imports still fail
>>> from com.sun.star.chart2 import InterpretedData
>>> from com.sun.star.chart2 import XDataInterpreter
>>> from com.sun.star.chart2 import XTransformation

I personally don't need these import at this time.

It does seem to me all the same that the other imports should be fixed.
They work in LO 7.3
Why, without being first depreciated would they be removed?
Comment 12 Noel Grandin 2022-11-29 13:54:27 UTC
> Why, without being first depreciated would they be removed?

Because there was never a reason for any client/extension code to use them at all.

You only found them because you wrote some very good automatic-generated test code :-)
Comment 13 vibrationoflife 2022-11-30 17:21:01 UTC
hmmm... fair enough.

If these imports can't actually be imported. Should they not be removed from the API?

My https://github.com/Amourspirit/ooo_uno_tmpl project converts the entire API into python class and python typings.

As it stands when 7.4 of API get published some the the test will actually fail because that would be listed in the API online but not actually exsiting.
Comment 14 Noel Grandin 2022-11-30 18:12:07 UTC
(In reply to vibrationoflife from comment #13)
> If these imports can't actually be imported. Should they not be removed from
> the API?
> 

So it's quite a lot of work to figure out if it is safe to remove some UNO API (and sometimes I still get it wrong, ie. see this bug.)

So we typically only remove UNO API in service of some other goal. In this case I removed the UNO API to make it possible to optimise some chart operations - displaying large sets of data in our charts is still a long way from being quick.
Comment 15 Xisco Faulí 2022-12-30 12:01:41 UTC
*** Bug 152732 has been marked as a duplicate of this bug. ***
Comment 16 Commit Notification 2023-01-10 18:26:23 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4440f321fcf0157ef52e988dd519d79efd49565b

tdf#151846: sw_macros: Add unittest

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.