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

Support multiple Actual server versions at once #57

Open
bvanelli opened this issue Aug 16, 2024 · 16 comments
Open

Support multiple Actual server versions at once #57

bvanelli opened this issue Aug 16, 2024 · 16 comments
Labels
enhancement New feature or request

Comments

@bvanelli
Copy link
Owner

Description

As described in #51 (comment), mhe main issue is that I intended to support multiple versions on Actual, but sqlalchemy emit statements for all columns when doing an insert. For example, when inserting a payee:

E       [SQL: INSERT INTO payees (id, name, category, transfer_acct, favorite) VALUES (?, ?, ?, ?, ?)]
E       [parameters: ('835983d9-1e5e-4c24-bca5-55acea558f2c', None, None, '99293e48-4f92-4d92-a1f1-cd4f4c126d22', None)]

This code works fine for actual 24.8.0, but not on 24.7.0, because there the column favorite does not exist. I tried using sqlalchemy deferred column but that is only effective on selects, not inserts.

This is extremely annoying because I then need either:

  • Multiple models of the database, one per version, and deciding each one on the go when connecting to the server or
  • Have "templated" models that would load the attributes lazily, but only when they are confirmed to exist on the database

I like the second idea more, but it's a bit difficult to implement.

@bvanelli bvanelli added the enhancement New feature or request label Aug 16, 2024
@rodriguestiago0
Copy link

rodriguestiago0 commented Nov 12, 2024

Why not just support the latest version?

If you want a older version you can just use an older version of actualpy

@bvanelli
Copy link
Owner Author

@rodriguestiago0 this is what I'm currently doing, the issue with just reverting to an older version is that I don't actually label them so, so it's hard to know to which version you should revert to.

But for sure I'm not considering implementing this in the near future, because the challenge is quite big, since i would have to modify how sqlalchemy emits queries.

@rodriguestiago0
Copy link

Can we release it with the api latest version?

@bvanelli
Copy link
Owner Author

bvanelli commented Nov 13, 2024

Can we release it with the api latest version?

Maybe I did not understand what you meant, but you suggested releasing the supported Actual APIs versions on the releases page?

@rodriguestiago0
Copy link

rodriguestiago0 commented Nov 13, 2024 via email

@bvanelli
Copy link
Owner Author

I believe the current version already supports latest 24.11.0. The only change I did since then was the optimization when redownloading the files.

@rodriguestiago0
Copy link

rodriguestiago0 commented Nov 13, 2024 via email

@rodriguestiago0
Copy link

rodriguestiago0 commented Nov 13, 2024 via email

@bvanelli
Copy link
Owner Author

Could you provide details in a new issue? Seems like a bug to me.

@rodriguestiago0
Copy link

rodriguestiago0 commented Nov 13, 2024 via email

@bvanelli
Copy link
Owner Author

I assumed you typed this by hand since the upper case should not be there for 'Name'. Could you open an issue and place s reproducible script of what you are trying to do?

@rodriguestiago0
Copy link

No, I'm using https://github.com/bobokun/actualtap-py and I'm getting this error

@rodriguestiago0
Copy link

rodriguestiago0 commented Nov 18, 2024

"Actual found a column not supported by the library: column 'Name' at table 'payees' not found\n"
Error occurred when
with Actual(settings.actual_url, password=settings.actual_password, file=settings.actual_budget) as actual:

@bvanelli
Copy link
Owner Author

@rodriguestiago0 are you able to check the version of the library by importing it in your script?

import actual

print(actual.__version__)

If that is the latest version I would need to know which row change is failing.

@rodriguestiago0
Copy link

Version: 0.7.0

How can I know the row?

@bvanelli
Copy link
Owner Author

Version: 0.7.0

How can I know the row?

You can update the print slighly on the part that is failing:

                if column is None:
                    raise ActualError(
                        f"Actual found a column not supported by the library: "
                        f"column '{message.column}' at table '{message.dataset}' not found, {message}\n"
                    )

But I believe that this will not be helpful, as it seems to me like the column somehow got corrupted due to some other issue with actual. Can you try resetting the budget sync like described in the docs https://actualbudget.org/docs/settings/#reset-sync and see if that helps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants