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

Outlook bug #710

Merged
merged 12 commits into from
Jul 17, 2023
Merged

Outlook bug #710

merged 12 commits into from
Jul 17, 2023

Conversation

Diego-H-S
Copy link
Contributor

Summary

  • In the subject parameter occasionally appears an extra separator, which has been solved by replacing it with a space.
  • When the length of the receivers parameter is longer than 8000 (maximum length for creating a varchar) the string is truncated to the latest email added to this receivers parameter.

Importance

It happened in the past but I would be necessary to avoid similar situations in the future.

Checklist

This PR:

  • follows the guidelines laid out in CONTRIBUTING.md
  • links relevant issue(s)
  • adds/updates tests (if appropriate)
  • adds/updates docstrings (if appropriate)
  • adds an entry in CHANGELOG.md

@Diego-H-S Diego-H-S requested a review from Rafalz13 June 21, 2023 11:55
Copy link
Contributor

@Rafalz13 Rafalz13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Added comments.
  • Please add tests for this functionality with 8000.

viadot/sources/outlook.py Outdated Show resolved Hide resolved
Comment on lines 187 to 190
if sum(list(map(len, [recivers, add_string]))) >= 8000:
break
else:
recivers += add_string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion - what do you think about using only 1 if to this case?

Suggested change
if sum(list(map(len, [recivers, add_string]))) >= 8000:
break
else:
recivers += add_string
if sum(list(map(len, [recivers, add_string]))) < 8000:
recivers += add_string

Copy link
Contributor Author

@Diego-H-S Diego-H-S Jun 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The end is the same, because, I need to break the for loop when it reaches 8000, after that limit you are iterating without any purpose.
If I use your sentence, then I would need an else: break which is basically the same as it is already there.

viadot/sources/outlook.py Show resolved Hide resolved
@Diego-H-S Diego-H-S requested a review from Rafalz13 June 23, 2023 13:46
Copy link
Contributor

@Rafalz13 Rafalz13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add or modify tests for new features:

  • break if >= 8000
  • handling receivers

viadot/sources/outlook.py Show resolved Hide resolved
Copy link
Contributor Author

@Diego-H-S Diego-H-S left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a new parameter and updated test file.

viadot/sources/outlook.py Show resolved Hide resolved
@Diego-H-S Diego-H-S requested a review from Rafalz13 July 10, 2023 11:45
@Rafalz13
Copy link
Contributor

Please reduce logs to only directories where we can find some messages. In the previous version, a user was able to see everything. (It was a long log message)

@Diego-H-S
Copy link
Contributor Author

Please reduce logs to only directories where we can find some messages. In the previous version, a user was able to see everything. (It was a long log message)

I have updated the source file to print out only folders with some messages.

@Rafalz13 Rafalz13 merged commit 8964c8e into dyvenia:dev Jul 17, 2023
3 checks passed
@Diego-H-S Diego-H-S deleted the Outlook_subject branch June 7, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants