question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Circular reference error

See original GitHub issue

When trying to log pandas dataframe constructed via function, an error occurs. Using .copy(deep=True) doesn’t help.

Example code:

from sklego.model_selection import TimeGapSplit
from datetime import timedelta

cv = TimeGapSplit(
    date_serie=df.reset_index("time").loc[:, "time"],
    train_duration=timedelta(days=7),
    valid_duration=timedelta(days=1),
    gap_duration=timedelta(days=0),
    n_splits=3,
)


table_plot = cv.summary(df)
title = "cross-validation folds"
series = "1"
Logger.current_logger().report_table(title=title, series=series, table_plot=table_plot)

Actual result:

ValueError: Circular reference detected

UPD: This did not help:

df_ = cv.summary(df_dev)
_df = pd.DataFrame(data=df_.values, index=df_.index, columns=df_.columns)

table_plot = _df
title = "cross-validation folds"
series = "1"
Logger.current_logger().report_table(title=title, series=series, table_plot=table_plot)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ColdTeapot273Kcommented, Dec 15, 2021

@jkhenning tested on 1.1.5rc4, works, nice job!

Wouldn’t call it too readable, but that’s on pandas/plotly team. At least it doesn’t break now so doesn’t make you write ad hoc boilerplate for type conversion.

1reaction
jkhenningcommented, Dec 10, 2021

@ColdTeapot273K we might have found a way to support it by using to_json() and letting pandas handle it 🙂 - I’ll update when an RC with this fix is available

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove or allow a circular reference - Microsoft Support
If you can't find the error, click the Formulas tab, click the arrow next to Error Checking, point to Circular References, and then...
Read more >
How to fix a circular reference error - Excel formula - Exceljet
"There are one or more circular references where a formula refers to its own cell either directly or indirectly. This might cause them...
Read more >
How to Fix the Excel Circular Reference Error? - Simon Sez IT
A circular reference, as the name suggests happens when any formula directly or indirectly refers back to its own results. This creates an...
Read more >
How to Find and Fix Circular References in Excel
In simple terms, a circular reference happens when a formula references back to its own cell directly or indirectly, creating an endless loop...
Read more >
How To Find and Remove Circular References in Excel - Indeed
The error message appears in a dialog box in the middle of your screen. It offers a simple definition of a circular reference,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found