Python - Old pandas merge results in more rows than new pandas
At the end the issue lied within new Pandas' approach to handle NaN values.
While in the old Pandas the code changed the NaN values with <NA> (as string), in the new Pandas it just left it as nan (pd.nan type).
I made sure to do df.fillna('<NA>', inplace=True) and it worked fine. The resulted DataFrame now has the same number of rows as produced by the old Pandas.
I have 2 environments:
Environment #1:

Python 3.7.5
Pandas 0.23.4

Environment #2:

Python 3.8.10
Pandas 1.3.4

I have the same code in both versions, no modifications were made to it. However, I have this specific line of code which seems to be causing an issue/produces a different output:
df_result = pd.merge(df_l, df_r, left_on=left_on, right_on=right_on, how='inner', suffixes=suffixes)
df_l and df_r are just read Excel files. I checked them in debugger in both versions and they are completely the same, so that should be fine.
Also, the left_on, right_on and suffixes variables have exactly the same value in both environments (checked via debugger, as well).
However, when the df_result gets generated by the merge function, in environment #1 (old Python, old Pandas) it produces a DataFrame with 16170 rows. In environment #2 (new Python, new Pandas) it produces a DataFrame with only 8249 rows.
The number of columns are the same, difference is only in number of rows.
What is causing this behavior?
How do I make sure that the environment #2 (new Python, new Pandas) produces exactly the same output with 16170 rows as produced by environment #1 (old Python, old Pandas)?
Thank you.