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

UDF formula is erased on return #1010

Closed
Colin-b opened this issue Dec 14, 2018 · 2 comments
Closed

UDF formula is erased on return #1010

Colin-b opened this issue Dec 14, 2018 · 2 comments
Labels
Milestone

Comments

@Colin-b
Copy link
Contributor

Colin-b commented Dec 14, 2018

OS (e.g. Windows 10 or macOS Sierra)

Windows 7 64

Versions of xlwings, Excel and Python (e.g. 0.11.8, Office 365, Python 3.7)

xlwings 0.15.1. Office 365, Python 3.6.5

Describe your issue (incl. Traceback!)

Formula is erased sometimes when sending a call while another one is in progress.
I did not really dig deep but I am able to reproduce by calling either one of the provided UDF.
Steps to reproduce for each formula are in comment, try to have the int parameter in another cell and increment the value as fast as possible to reproduce the issue.

I let you chose which one to use for your testing :)

As you would guess this issue is kinda critical, if you need some help investigating I will be happy to try to find some time :)

Include a minimal code sample to reproduce the issue (and attach a sample workbook if required!)

No specific workbook settings.

import xlwings as xw
import time


@xw.func(async_mode='threading')
@xw.arg('behavior', numbers=int)
@xw.ret(expand='table')
def formula_erased_1(behavior):
    # Call 1 then as soon as you can call 2, then 3, then 4, bug will occur when you will be able to hit enter multiple time but Excel still hasnt processed your ENTER press
    time.sleep(5)
    if behavior == 1:
        return [['value'] * 20] * 61200
    return []


@xw.func(async_mode='threading')
@xw.arg('behavior', numbers=int)
@xw.ret(expand='table')
def formula_erased_2(behavior):
    # Call 1 then as soon as you can call 2, then 3 -- Formula will disapear as you will call 3 before 2 even returned
    if behavior == 1:
        return [['value'] * 20] * 300
    if behavior == 2:
        time.sleep(20)
        return [['value'] * 20] * 250
    return [['value'] * 20] * 200
@fzumstein
Copy link
Member

fzumstein commented Dec 15, 2018

nice effect ;) I managed to reproduce the issue with your 2nd example, but don't know yet how easy it will be to fix.

@fzumstein
Copy link
Member

fix by #1318

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

No branches or pull requests

2 participants